summaryrefslogtreecommitdiff
path: root/test/ruby/test_enumerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r--test/ruby/test_enumerator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 3cb9dc789f..bd6b7fa669 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -646,5 +646,10 @@ class TestEnumerator < Test::Unit::TestCase
e.next
assert_raise(StopIteration) { e.peek }
end
+
+ def test_uniq
+ assert_equal([1, 2, 3, 4, 5, 10],
+ (1..Float::INFINITY).lazy.uniq{|x| (x**2) % 10 }.first(6))
+ end
end