Skip to content

Instantly share code, notes, and snippets.

@rafaelfranca
Created May 19, 2015 03:54
Show Gist options
  • Save rafaelfranca/4415cbbbf55ef95df119 to your computer and use it in GitHub Desktop.
Save rafaelfranca/4415cbbbf55ef95df119 to your computer and use it in GitHub Desktop.
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 2c6eda0..012a562 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -268,6 +268,18 @@ class TestBignum < Test::Unit::TestCase
assert_equal(2**180, (2**80) * o)
end
+ def test_positive_p
+ assert_predicate(T_ONE, :positive?)
+ assert_not_predicate(T_MONE, :positive?)
+ assert_not_predicate(T_ZERO, :positive?)
+ end
+
+ def test_negative_p
+ assert_not_predicate(T_ONE, :negative?)
+ assert_predicate(T_MONE, :negative?)
+ assert_not_predicate(T_ZERO, :negative?)
+ end
+
def test_mul_balance
assert_equal(3**7000, (3**5000) * (3**2000))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment