[macruby-changes] [1269] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 30 11:48:58 PDT 2009


Revision: 1269
          http://trac.macosforge.org/projects/ruby/changeset/1269
Author:   pthomson at apple.com
Date:     2009-03-30 11:48:58 -0700 (Mon, 30 Mar 2009)
Log Message:
-----------
Added three more tests, one of which necessitated changing the spec (Ruby 1.8's readchar() returned an int, whereas 1.9 returns a one-character string. Are we using old specs?

Modified Paths:
--------------
    MacRuby/branches/experimental/io.c
    MacRuby/branches/experimental/rakelib/spec.rake
    MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb

Modified: MacRuby/branches/experimental/io.c
===================================================================
--- MacRuby/branches/experimental/io.c	2009-03-30 18:13:14 UTC (rev 1268)
+++ MacRuby/branches/experimental/io.c	2009-03-30 18:48:58 UTC (rev 1269)
@@ -2203,7 +2203,9 @@
     if (fd == -1) {
 	rb_sys_fail(NULL);
     }
-    prepare_io_from_fd(ExtractIOStruct(io), fd, convert_mode_string_to_fmode(modes));
+	rb_io_t *io_struct = ExtractIOStruct(io);
+    prepare_io_from_fd(io_struct, fd, convert_mode_string_to_fmode(modes));
+	GC_WB(&io_struct->path, path); 
     return io;
 }
 

Modified: MacRuby/branches/experimental/rakelib/spec.rake
===================================================================
--- MacRuby/branches/experimental/rakelib/spec.rake	2009-03-30 18:13:14 UTC (rev 1268)
+++ MacRuby/branches/experimental/rakelib/spec.rake	2009-03-30 18:48:58 UTC (rev 1269)
@@ -29,11 +29,16 @@
   
   KNOWN_GOOD_CORE_IO = %w{
     closed
+    fileno
+    inspect
+    readchar
     to_i
     to_io
     initialize
   }
   
+  # 
+  
   desc "Run all language known good spec files which should be fully green (does not use tags)"
   task :green do
     files = FileList["spec/frozen/language/{#{KNOWN_GOOD.join(',')}}_spec.rb"]

Modified: MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb	2009-03-30 18:13:14 UTC (rev 1268)
+++ MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb	2009-03-30 18:48:58 UTC (rev 1269)
@@ -12,12 +12,12 @@
   end
 
   it "returns the next byte from the stream" do
-    @file.readchar.should == 86
-    @file.readchar.should == 111
-    @file.readchar.should == 105
+    @file.readchar.should == 'V'
+    @file.readchar.should == 'o'
+    @file.readchar.should == 'i'
     # read the rest of line
     @file.readline.should == "ci la ligne une.\n"
-    @file.readchar.should == 81
+    @file.readchar.should == 'Q'
   end
 
   it "raises EOFError when invoked at the end of the stream" do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090330/b3c95a38/attachment.html>


More information about the macruby-changes mailing list