summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-02 22:48:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-02 22:49:42 +0900
commit79b242260bc0530503dde85eda8e79b1c2aa9a6e (patch)
treefdc2aae41ecfd2c5f70345f7d30159974c1cfcf1 /test
parent539b89075a61f27c8b5b5cd749f66bda47bc78b0 (diff)
ripper: Invalid pragma value warning
Diffstat (limited to 'test')
-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 4e1d233851..771434ff82 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1588,6 +1588,12 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal("frozen_string_literal", args[0])
end
+ def test_warning_invalid_magic_comment
+ fmt, *args = warning("#-*- frozen-string-literal: nottrue -*-")
+ assert_match(/invalid value/, fmt)
+ assert_equal(%w"frozen_string_literal nottrue", args)
+ end
+
def test_warn_cr_in_middle
fmt = nil
assert_warn("") {fmt, = warn("\r;")}