[MacRuby] #953: StringIO#dup is broken.
#953: StringIO#dup is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- {{{ #!ruby require 'stringio' def assert_equal(x, y) if x == y puts "ok" else puts "ng : x = #{x.inspect} : y = #{y.inspect}" end end f1 = StringIO.new("1234") assert_equal("1", f1.getc) f2 = f1.dup assert_equal("2", f2.getc) assert_equal("3", f1.getc) assert_equal("4", f2.getc) assert_equal(nil, f1.getc) assert_equal(true, f2.eof?) f1.close assert_equal(true, f2.closed?) }}} Result: {{{ $ ruby19 -v test_stringio.rb ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] ok ok ok ok ok ok ok $ macruby -v test_stringio.rb MacRuby 0.8 (ruby 1.9.2) [universal-darwin10.0, x86_64] ok ok ng : x = "3" : y = "2" ng : x = "4" : y = "3" ng : x = nil : y = "3" ng : x = true : y = false ng : x = true : y = false }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/953> MacRuby <http://macruby.org/>
#953: StringIO#dup is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): I looked at this problem and it will be hard to fix it with the current stringio (pure Ruby) implementation. StringIO#dup returns a new object which points to the same StringIO "state" (string, position, and so on). If our stringio is rewritten in C, it will be easier to share the same as a common structure. -- Ticket URL: <http://www.macruby.org/trac/ticket/953#comment:1> MacRuby <http://macruby.org/>
#953: StringIO#dup is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: #reduction ----------------------------------+----------------------------------------- Changes (by mattaimonetti@…): * keywords: => #reduction -- Ticket URL: <http://www.macruby.org/trac/ticket/953#comment:2> MacRuby <http://macruby.org/>
#953: StringIO#dup is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby Later Component: MacRuby | Keywords: #reduction ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby Later Comment: For Later. -- Ticket URL: <http://www.macruby.org/trac/ticket/953#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby