diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-20 03:03:12 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-20 03:03:12 +0000 |
commit | f2d01d14785e48b78be98fd805fef2c1334d2a71 (patch) | |
tree | 06ba1f3fbd0bcf3b94f3273d5c5982191af35e30 /test/ripper/test_scanner_events.rb | |
parent | 917f067885810d3639eee3b12f879fd1e86e9052 (diff) | |
download | ruby-f2d01d14785e48b78be98fd805fef2c1334d2a71.tar.gz |
* parse.y [ripper]: unify old_lex_p and token_head.
* test/ripper/test_scanner_events.rb: now \r\n is saved correctly.
* parse.y: new macro lex_goto_eol() for next change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_scanner_events.rb')
-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 |