summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-03-02 11:21:10 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-03-02 11:21:10 +0000
commitdad70fa6a85990f61ec76a62456fde153e093af4 (patch)
tree01d9dffc167afe7f5f49f8a0e9f92408c15024fc /test
parente5bc1fea43b6694893d7cb6550401f7dcfd2b924 (diff)
merge revision(s) 263b9413: [Backport #16981]
[ripper] fix mismatched indentations warning [Bug #16981] The scanner location has to be set from lex.ptok before it is flushed by dispatching the scanner event. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 95ec661fcf..1f2f960020 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1498,4 +1498,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_warn("") {fmt, = warn("\r;")}
assert_match(/encountered/, fmt)
end
+
+ def test_warn_mismatched_indentations
+ fmt, tokend, tokbeg, line = assert_warning("") {break warn("if true\n end\n")}
+ assert_match(/mismatched indentations/, fmt)
+ assert_equal(["if", "end", 1], [tokbeg, tokend, line])
+ end
end if ripper_test