diff options
author | Kazuki Tsujimoto <[email protected]> | 2020-12-13 11:50:14 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <[email protected]> | 2020-12-13 11:51:49 +0900 |
commit | 88f3ce12d32ffbef983b0950743c20253ea2d0c6 (patch) | |
tree | 8ff07aa837af75a4e389ef30d139fb391be63e0f /test/ruby/test_pattern_matching.rb | |
parent | a8cf526ae99c9e0823cd8c7c5ac96e43061fafa6 (diff) |
Reintroduce `expr in pat` [Feature #17371]
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index b155cb8579..e553789756 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1451,7 +1451,7 @@ END ################################################################ - def test_assoc + def test_one_line 1 => a assert_equal 1, a assert_raise(NoMatchingPatternError) do @@ -1464,6 +1464,9 @@ END assert_syntax_error(%q{ 1 => a: }, /unexpected/, '[ruby-core:95098]') + + assert_equal true, (1 in 1) + assert_equal false, (1 in 2) end def assert_experimental_warning(code) @@ -1481,6 +1484,7 @@ END def test_experimental_warning assert_experimental_warning("case [0]; in [*, 0, *]; end") assert_experimental_warning("0 => 0") + assert_experimental_warning("0 in a") end end END_of_GUARD |