summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/prism/errors_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb
index 304d55274e..b7215c755d 100644
--- a/test/prism/errors_test.rb
+++ b/test/prism/errors_test.rb
@@ -1871,6 +1871,16 @@ module Prism
]
end
+ def test_warnings_verbosity
+ warning = Prism.parse("def foo; END { }; end").warnings[0]
+ assert_equal "END in method; use at_exit", warning.message
+ assert_equal :warning_verbose_not_nil, warning.level
+
+ warning = Prism.parse("foo /regexp/").warnings[0]
+ assert_equal "ambiguous `/`; wrap regexp in parentheses or add a space after `/` operator", warning.message
+ assert_equal :warning_verbose_true, warning.level
+ end
+
def test_statement_operators
source = <<~RUBY
alias x y + 1