summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 07:12:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 07:12:56 +0000
commitb0fb3ff1b294e692b3fbb200d321c193eddf5ac6 (patch)
treea612c129fd5af748c39c4686d31e8ee1d115c8c4 /test/ripper/test_parser_events.rb
parent70d2b335f29934411698c3dd98374b6979dc1486 (diff)
parse.y: ripper for warnings
* parse.y (parser_yylex): deal with magic comment warnings also in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 fec01f1..2b9f97a 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;")}