Issue #6179 has been updated by phasis68 (Heesob Park).


This issue is related with new line conversion.
I think Revision 35095 made a wrong test case.

test_pos_with_getc methods should be modified like this:

  def test_pos_with_getc
    bug6179 = '[ruby-core:43497]'
    t = make_tempfile
    open(t.path, "w") do |f|
      f.write "0123456789\n"
    end

    open(t.path, "r") do |f|
      assert_equal 0, f.pos
      assert_equal '0', f.getc
      assert_equal 1, f.pos
      assert_equal '1', f.getc
      assert_equal 2, f.pos
      assert_equal '2', f.getc
      assert_equal 3, f.pos
      assert_equal '3', f.getc
      assert_equal 4, f.pos
      assert_equal '4', f.getc
    end
  end

----------------------------------------
Bug #6179: File::pos broken in Windows 1.9.3p125
https://bugs.ruby-lang.org/issues/6179#change-25033

Author: jmthomas (Jason Thomas)
Status: Assigned
Priority: Normal
Assignee: h.shirosaki (Hiroshi Shirosaki)
Category: core
Target version: 1.9.3
ruby -v: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]


Calling the pos method on a File in the Windows version of Ruby on 1.9.3p125 moves the file pointer. Thus it can not be called without side effect.


-- 
http://bugs.ruby-lang.org/