From 828c5ec400ccac53fec11f6d00e9ac6edec65685 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 4 Feb 2005 17:25:09 +0000 Subject: [PATCH] * test/ripper/test_scanner_events.rb: fix test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ test/ripper/test_scanner_events.rb | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index b76467cb8f..de434679bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Feb 5 02:24:06 2005 Minero Aoki + + * test/ripper/test_scanner_events.rb: fix test. + Fri Feb 4 18:44:35 2005 Minero Aoki * ext/ripper/lib/ripper/lexer.rb: last Lexer fix was incomplete; diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 57be40c4dc..0beb8c09f9 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -9,7 +9,7 @@ class TestRipper_ScannerEvents < Test::Unit::TestCase def scan(target, str) sym = "on_#{target}".intern - Ripper.scan(str).select {|_,type,_| type == sym }.map {|_,_,tok| tok } + Ripper.lex(str).select {|_,type,_| type == sym }.map {|_,_,tok| tok } end def test_tokenize @@ -29,13 +29,13 @@ class TestRipper_ScannerEvents < Test::Unit::TestCase Ripper.tokenize("\#\n\n\#\n\nnil\n") end - def test_scan + def test_lex assert_equal [], - Ripper.scan('') + Ripper.lex('') assert_equal [[[1,0], :on_ident, "a"]], - Ripper.scan('a') + Ripper.lex('a') assert_equal [[[1, 0], :on_kw, "nil"]], - Ripper.scan("nil") + Ripper.lex("nil") assert_equal [[[1, 0], :on_kw, "def"], [[1, 3], :on_sp, " "], [[1, 4], :on_ident, "m"], @@ -43,18 +43,18 @@ class TestRipper_ScannerEvents < Test::Unit::TestCase [[1, 6], :on_ident, "a"], [[1, 7], :on_rparen, ")"], [[1, 8], :on_kw, "end"]], - Ripper.scan("def m(a)end") + Ripper.lex("def m(a)end") assert_equal [[[1, 0], :on_int, "1"], [[1, 1], :on_nl, "\n"], [[2, 0], :on_int, "2"], [[2, 1], :on_nl, "\n"], [[3, 0], :on_int, "3"]], - Ripper.scan("1\n2\n3") + Ripper.lex("1\n2\n3") assert_equal [[[1, 0], :on_heredoc_beg, "<