diff options
| author | Michael V. O'Brien <michael@reductivelabs.com> | 2007-09-10 14:28:02 -0500 |
|---|---|---|
| committer | Michael V. O'Brien <michael@reductivelabs.com> | 2007-09-10 14:28:02 -0500 |
| commit | 19a748bb9e1fcdc574dca9de4ee82bd017627a19 (patch) | |
| tree | 36c844e843dacfef30d28ada2cc17ce2564bd6bf /test | |
| parent | 041393d1462b44438ede6dcf47fb05ec1084c998 (diff) | |
| download | puppet-19a748bb9e1fcdc574dca9de4ee82bd017627a19.tar.gz puppet-19a748bb9e1fcdc574dca9de4ee82bd017627a19.tar.xz puppet-19a748bb9e1fcdc574dca9de4ee82bd017627a19.zip | |
Removed TYPE token, replacing it with CLASSREF token, in the grammar and lexer. Updated CLASSREF token regex in the lexer.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/language/lexer.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/language/lexer.rb b/test/language/lexer.rb index 7b4909fb1..c2dd17324 100755 --- a/test/language/lexer.rb +++ b/test/language/lexer.rb @@ -111,7 +111,7 @@ class TestLexer < Test::Unit::TestCase types.each { |t| @lexer.string = t assert_equal( - [[:TYPE,t],[false,false]], + [[:CLASSREF,t],[false,false]], @lexer.fullscan ) } @@ -254,6 +254,24 @@ class TestLexer < Test::Unit::TestCase @lexer.scan {} assert_equal("]", @lexer.expected, "expected value is wrong after pop") end + + # #774 + def test_classref_token + string = ["Foo", "::Foo","Foo::Bar","::Foo::Bar"] + + string.each do |foo| + assert_nothing_raised { + @lexer.string = foo + } + + ret = nil + assert_nothing_raised { + ret = @lexer.fullscan + } + + assert_equal([:CLASSREF, foo],ret[0], "Did not correctly tokenize '%s'" % foo) + end + end end # $Id$ |
