summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_prime.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_prime.rb b/test/test_prime.rb
index d4f0564..48b017e 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -106,6 +106,13 @@ class TestPrime < Test::Unit::TestCase
end
end
+ def test_enumerator_size
+ enum = Prime.each
+ assert_equal Float::INFINITY, enum.size
+ assert_equal Float::INFINITY, enum.with_object(nil).size
+ assert_equal Float::INFINITY, enum.with_index(42).size
+ end
+
def test_default_instance_does_not_have_compatibility_methods
assert !Prime.instance.respond_to?(:succ)
assert !Prime.instance.respond_to?(:next)