aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index fec01f10d2..2b9f97a481 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1315,6 +1315,12 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_match(/x/, fmt % args)
end
+ def test_warning_ignored_magic_comment
+ fmt, *args = warning("1; #-*- frozen-string-literal: true -*-")
+ assert_match(/ignored after any tokens/, fmt)
+ assert_equal("frozen_string_literal", args[0])
+ end
+
def test_warn_cr_in_middle
fmt = nil
assert_warn("") {fmt, *args = warn("\r;")}