summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ripper/test_scanner_events.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
index 7186df3971..66ae07cc6b 100644
--- a/test/ripper/test_scanner_events.rb
+++ b/test/ripper/test_scanner_events.rb
@@ -90,28 +90,28 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase
end
def test_location
- validate_location ""
- validate_location " "
- validate_location "@"
- validate_location "\n"
- validate_location "\r\n"
- validate_location "\n\n\n\n\n\r\n\n\n"
- validate_location "\n;\n;\n;\n;\n"
- validate_location "nil"
- validate_location "@ivar"
- validate_location "1;2;3"
- validate_location "1\n2\n3"
- validate_location "1\n2\n3\n"
- validate_location "def m(a) nil end"
- validate_location "if true then false else nil end"
- validate_location "BEGIN{print nil}"
- validate_location "%w(a b\nc\r\nd \ne )"
- validate_location %Q["a\nb\r\nc"]
- validate_location "print(<<""EOS)\nheredoc\nEOS\n"
- validate_location "print(<<-\"EOS\")\nheredoc\n EOS\n"
- end
-
- def validate_location(src)
+ assert_location ""
+ assert_location " "
+ assert_location "@"
+ assert_location "\n"
+ assert_location "\r\n"
+ assert_location "\n\n\n\n\n\r\n\n\n"
+ assert_location "\n;\n;\n;\n;\n"
+ assert_location "nil"
+ assert_location "@ivar"
+ assert_location "1;2;3"
+ assert_location "1\n2\n3"
+ assert_location "1\n2\n3\n"
+ assert_location "def m(a) nil end"
+ assert_location "if true then false else nil end"
+ assert_location "BEGIN{print nil}"
+ assert_location "%w(a b\nc\r\nd \ne )"
+ assert_location %Q["a\nb\r\nc"]
+ assert_location "print(<<""EOS)\nheredoc\nEOS\n"
+ assert_location "print(<<-\"EOS\")\nheredoc\n EOS\n"
+ end
+
+ def assert_location(src)
buf = ''
Ripper.lex(src).each do |pos, type, tok|
line, col = *pos