[macruby-changes] [1871] MacRuby/branches/experimental/spec

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 17 17:39:10 PDT 2009


Revision: 1871
          http://trac.macosforge.org/projects/ruby/changeset/1871
Author:   lsansonetti at apple.com
Date:     2009-06-17 17:39:09 -0700 (Wed, 17 Jun 2009)
Log Message:
-----------
adjusted a few specs according to the floating point optimization change

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/modulo_tags.txt
    MacRuby/branches/experimental/spec/macruby/fixtures/method.m

Added Paths:
-----------
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/exponent_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/remainder_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/hash/invert_tags.txt
    MacRuby/branches/experimental/spec/macruby/core/float_spec.rb

Modified: MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb	2009-06-18 00:38:32 UTC (rev 1870)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/shared/object_id.rb	2009-06-18 00:39:09 UTC (rev 1871)
@@ -53,10 +53,12 @@
     o1.send(@method).should_not == o2.send(@method)
   end
 
-  it "returns a different value for two Float literals" do
-    o1 = 1.0
-    o2 = 1.0
-    o1.send(@method).should_not == o2.send(@method)
+  not_compliant_on :macruby do
+    it "returns a different value for two Float literals" do
+      o1 = 1.0
+      o2 = 1.0
+      o1.send(@method).should_not == o2.send(@method)
+    end
   end
 
   it "returns a different value for two String literals" do

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/exponent_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/exponent_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/exponent_tags.txt	2009-06-18 00:39:09 UTC (rev 1871)
@@ -0,0 +1 @@
+fails:Bignum#** returns self raised to other power

Modified: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/modulo_tags.txt	2009-06-18 00:38:32 UTC (rev 1870)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/modulo_tags.txt	2009-06-18 00:39:09 UTC (rev 1871)
@@ -3,3 +3,4 @@
 critical:Bignum#modulo does not raise a FloatDomainError when the given argument is 0 and a Float
 critical:Bignum#modulo raises a TypeError when given a non-Integer
 fails:Bignum#% raises a TypeError when given a non-Integer
+fails:Bignum#% returns the modulus obtained from dividing self by the given argument

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/remainder_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/remainder_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/bignum/remainder_tags.txt	2009-06-18 00:39:09 UTC (rev 1871)
@@ -0,0 +1 @@
+fails:Bignum#remainder returns the remainder of dividing self by other

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/hash/invert_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/hash/invert_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/hash/invert_tags.txt	2009-06-18 00:39:09 UTC (rev 1871)
@@ -0,0 +1 @@
+fails:Hash#invert compares new keys with eql? semantics

Added: MacRuby/branches/experimental/spec/macruby/core/float_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/macruby/core/float_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/macruby/core/float_spec.rb	2009-06-18 00:39:09 UTC (rev 1871)
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + "/../spec_helper"
+
+describe "A MacRuby Float object" do
+  it "returns the same object_id than another equal Float literal" do
+    o1 = 1.0
+    o2 = 1.0
+    o1.object_id.should == o2.object_id
+  end
+end

Modified: MacRuby/branches/experimental/spec/macruby/fixtures/method.m
===================================================================
--- MacRuby/branches/experimental/spec/macruby/fixtures/method.m	2009-06-18 00:38:32 UTC (rev 1870)
+++ MacRuby/branches/experimental/spec/macruby/fixtures/method.m	2009-06-18 00:39:09 UTC (rev 1871)
@@ -264,7 +264,8 @@
 
 + (BOOL)testMethodReturningFloat:(TestMethod *)o
 {
-    return [o methodReturningFloat] == (float)3.1415;
+    float f = [o methodReturningFloat];
+    return f > 3.1414 && f < 3.1416;
 }
 
 - (double)methodReturningDouble
@@ -274,7 +275,8 @@
 
 + (BOOL)testMethodReturningDouble:(TestMethod *)o
 {
-    return [o methodReturningDouble] == (double)3.1415;
+    double f = [o methodReturningDouble];
+    return f > 3.1414 && f < 3.1416;
 }
 
 - (SEL)methodReturningSEL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090617/2184a2f8/attachment.html>


More information about the macruby-changes mailing list