From a861c74813b79fd3d5fb2cf69276e8f90a2a0ba3 Mon Sep 17 00:00:00 2001 From: TSUYUSATO Kitsune Date: Sun, 19 Nov 2023 11:12:06 +0900 Subject: [PATCH] Add a test --- test/ruby/test_syntax.rb | 5 +++++ 1 file changed, 5 insertions(+) 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")