summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTSUYUSATO Kitsune <[email protected]>2023-11-19 11:12:06 +0900
committerNobuyoshi Nakada <[email protected]>2023-11-21 14:07:47 +0900
commita861c74813b79fd3d5fb2cf69276e8f90a2a0ba3 (patch)
tree1986786708cb1a0d98e1beb4730cf52de4574053
parentfe746747b49efb310989792681e171559581920c (diff)
Add a test
-rw-r--r--test/ruby/test_syntax.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 8e960ee535..e78d30148c 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1727,6 +1727,11 @@ eom
assert_valid_syntax("tap {a = (break unless true)}")
end
+ def test_value_expr_in_singleton
+ mesg = /void value expression/
+ assert_syntax_error("class << (return); end", mesg)
+ end
+
def test_tautological_condition
assert_valid_syntax("def f() return if false and invalid; nil end")
assert_valid_syntax("def f() return unless true or invalid; nil end")