diff options
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 31457c35ba..a4dd37bad7 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -3,14 +3,17 @@ # require 'ripper' -raise 'ripper version differ' unless Ripper::Version == '0.1.0' require 'test/unit' class TestRipper_ScannerEvents < Test::Unit::TestCase class R < Ripper def R.scan(target, src) - new(src, target).parse.map {|id, tok| tok } + lex(target, src).map {|id, tok| tok } + end + + def R.lex(target, src) + new(src, target).parse end def initialize(src, target) @@ -696,7 +699,7 @@ class TestRipper_ScannerEvents < Test::Unit::TestCase R.scan('nl', "1 +\n1") assert_equal [], R.scan('nl', "1;\n") - assert_equal ["\n"], + assert_equal ["\r\n"], R.scan('nl', "1 + 1\r\n") assert_equal [], R.scan('nl', "1;\r\n") @@ -717,7 +720,7 @@ class TestRipper_ScannerEvents < Test::Unit::TestCase R.scan('ignored_nl', "1;\n") assert_equal [], R.scan('ignored_nl', "1 + 1\r\n") - assert_equal ["\n"], + assert_equal ["\r\n"], R.scan('ignored_nl', "1;\r\n") end |