summaryrefslogtreecommitdiffhomepage
path: root/test/t
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-07-13 18:05:01 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-07-13 18:05:01 +0900
commitb4cdced22fe1f25d8cf6fc499a2e2c9875f17e9e (patch)
tree44697631bb10ae64c9b35cd83beac582f18d4fca /test/t
parenta9fd2e646492699894d33eaf3de7336356ce6726 (diff)
downloadmruby-b4cdced22fe1f25d8cf6fc499a2e2c9875f17e9e.tar.gz
mruby-b4cdced22fe1f25d8cf6fc499a2e2c9875f17e9e.zip
`Enumerable#detect` {and `#find`} should call `ifnone`; fix #4484
It's an error in ISO specification; 15.3.2.2.4 and 15.3.2.2.7
Diffstat (limited to 'test/t')
-rw-r--r--test/t/enumerable.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/t/enumerable.rb b/test/t/enumerable.rb
index 652c304da..9e7602db7 100644
--- a/test/t/enumerable.rb
+++ b/test/t/enumerable.rb
@@ -45,7 +45,7 @@ end
assert('Enumerable#detect', '15.3.2.2.4') do
assert_equal 1, [1,2,3].detect() { true }
- assert_equal 'a', [1,2,3].detect("a") { false }
+ assert_equal 'a', [1,2,3].detect(->{"a"}) { false }
end
assert('Array#each_with_index', '15.3.2.2.5') do
@@ -64,7 +64,7 @@ end
assert('Enumerable#find', '15.3.2.2.7') do
assert_equal 1, [1,2,3].find() { true }
- assert_equal 'a', [1,2,3].find("a") { false }
+ assert_equal 'a', [1,2,3].find(->{"a"}) { false }
end
assert('Enumerable#find_all', '15.3.2.2.8') do