From 3cee99808d629c0ec493955ce8ea019d1f8a637b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 21 May 2019 10:29:34 +0900 Subject: [EXPERIMENTAL] Expression with modifier `in` [Feature #15865] --- test/ruby/test_iseq.rb | 2 +- test/ruby/test_pattern_matching.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'test/ruby') 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 -- cgit v1.2.3