Skip to content

Commit

Permalink
Move some numeric specs over to rubyspec
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Dec 15, 2013
1 parent 4a95206 commit 9f93f49
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 94 deletions.
12 changes: 0 additions & 12 deletions spec/opal/core/numeric/abs_spec.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/opal/core/numeric/downto_spec.rb

This file was deleted.

9 changes: 0 additions & 9 deletions spec/opal/core/numeric/equal_value_spec.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/opal/core/numeric/even_spec.rb

This file was deleted.

12 changes: 0 additions & 12 deletions spec/opal/core/numeric/magnitude_spec.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/opal/core/numeric/odd_spec.rb

This file was deleted.

19 changes: 19 additions & 0 deletions spec/opal/filters/bugs/numeric.rb
@@ -0,0 +1,19 @@
opal_filter "Fixnum bugs" do
fails "Integer#downto [stop] when self and stop are Fixnums raises a ArgumentError for invalid endpoints"

fails "Fixnum#to_s when no base given returns self converted to a String using base 10"

fails "Fixnum#zero? returns true if self is 0"
end

opal_filter "Fixnum#<< doesn't handle non-integers" do
fails "Fixnum#<< with n << m raises a TypeError when passed a String"
fails "Fixnum#<< with n << m raises a TypeError when passed nil"
fails "Fixnum#<< with n << m raises a TypeError when #to_int does not return an Integer"
fails "Fixnum#<< with n << m returns a Bignum == fixnum_min() * 2 when fixnum_min() << 1 and n < 0"
fails "Fixnum#<< with n << m returns a Bignum == fixnum_max() * 2 when fixnum_max() << 1 and n > 0"
fails "Fixnum#<< with n << m returns 0 when m < 0 and m is a Bignum"
fails "Fixnum#<< with n << m returns 0 when m < 0 and m == p where 2**p > n >= 2**(p-1)"
fails "Fixnum#<< with n << m returns n shifted right m bits when n < 0, m < 0"
fails "Fixnum#<< with n << m returns n shifted right m bits when n > 0, m < 0"
end
19 changes: 19 additions & 0 deletions spec/opal/rubyspecs
Expand Up @@ -12,6 +12,25 @@ core/true
library/singleton
library/observer

core/fixnum/abs_spec
core/fixnum/case_compare_spec
core/fixnum/comparison_spec
core/fixnum/equal_value_spec
core/fixnum/even_spec
core/fixnum/gt_spec
core/fixnum/gte_spec
core/fixnum/left_shift_spec
core/fixnum/lt_spec
core/fixnum/lte_spec
core/fixnum/magnitude_spec
core/fixnum/minus_spec
core/fixnum/odd_spec
core/fixnum/plus_spec
core/fixnum/to_s_spec
core/fixnum/zero_spec

core/integer/downto_spec

core/enumerator/each_spec
core/enumerator/new_spec
core/enumerator/next_spec
Expand Down

0 comments on commit 9f93f49

Please sign in to comment.