diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-24 07:12:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-24 07:12:56 +0000 |
commit | 53e10a2775e37c9e66210a66c9e46656a2684e13 (patch) | |
tree | a612c129fd5af748c39c4686d31e8ee1d115c8c4 /test/ripper | |
parent | d31953e0797a91c80eeb0412d3728393cdd39d1e (diff) | |
download | ruby-53e10a2775e37c9e66210a66c9e46656a2684e13.tar.gz |
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')
-rw-r--r-- | test/ripper/test_parser_events.rb | 6 |
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;")} |