[MacRuby] #189: Bugs with: Class#dup & Object#dup

MacRuby ruby-noreply at macosforge.org
Mon Oct 11 00:21:41 PDT 2010


#189: Bugs with: Class#dup & Object#dup
-------------------------------------+--------------------------------------
 Reporter:  eloy.de.enige@…          |       Owner:  lsansonetti@…        
     Type:  defect                   |      Status:  new                  
 Priority:  blocker                  |   Milestone:                       
Component:  MacRuby                  |    Keywords:                       
-------------------------------------+--------------------------------------

Comment(by watson1978@…):

 {{{
 #!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/189#comment:1>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list