summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-21 10:29:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-26 15:10:48 +0900
commit3cee99808d629c0ec493955ce8ea019d1f8a637b (patch)
treeec38ae37041a16a138f668e700570d74f7446e07 /test
parent1fe73dc8609c4bac9e517dc70f602a16dae556cc (diff)
[EXPERIMENTAL] Expression with modifier `in`
[Feature #15865]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2485
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iseq.rb2
-rw-r--r--test/ruby/test_pattern_matching.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 1a1abc627b..2aa6966785 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -434,7 +434,7 @@ class TestISeq < Test::Unit::TestCase
end
def test_to_binary_pattern_matching
- code = "case foo in []; end"
+ code = "case foo; in []; end"
iseq = compile(code)
assert_include(iseq.disasm, "TypeError")
assert_include(iseq.disasm, "NoMatchingPatternError")
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb
index 1f209b0081..cb87529ccf 100644
--- a/test/ruby/test_pattern_matching.rb
+++ b/test/ruby/test_pattern_matching.rb
@@ -1180,6 +1180,13 @@ END
end
end
end
+
+ ################################################################
+
+ def test_modifier_in
+ assert_equal true, (1 in a)
+ assert_equal 1, a
+ end
end
END_of_GUARD
$VERBOSE = verbose