diff options
author | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-08 18:22:29 +0000 |
---|---|---|
committer | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-08 18:22:29 +0000 |
commit | bef8e4557c260e4eccb6266c874b37b32b3ee7a9 (patch) | |
tree | 98874b138722af9c288165aeff3a46141f31fcab /test | |
parent | 16b8aadc75a50f8c9472f049de4e68678380b823 (diff) | |
download | ruby-bef8e4557c260e4eccb6266c874b37b32b3ee7a9.tar.gz |
* lib/prime.rb (Prime#prime?): negative numbers can't be primes
by definition. reported by Ivan Kataitsev. [Bug #7395]
* test/test_prime.rb: add test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_prime.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_prime.rb b/test/test_prime.rb index e89952948c..885406f9bd 100644 --- a/test/test_prime.rb +++ b/test/test_prime.rb @@ -141,8 +141,8 @@ class TestPrime < Test::Unit::TestCase # negative assert !-1.prime? - assert(-2.prime?) - assert(-3.prime?) + assert !-2.prime? + assert !-3.prime? assert !-4.prime? end end |