From b0fb3ff1b294e692b3fbb200d321c193eddf5ac6 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 24 Nov 2015 07:12:56 +0000 Subject: 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 --- test/ripper/test_parser_events.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ripper') 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;")} -- cgit v1.2.3