diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-11 16:34:07 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-11 16:34:07 -0500 |
| commit | c319fd059d2d563432700214d4946cf0bf925894 (patch) | |
| tree | c2b363143d7d18e7ff26a7fc995ef78f3019527e /test | |
| parent | bb69a1f08a6b0ba37222eeddf28ffbff657283e7 (diff) | |
| parent | 16380893452bfc0187aab85f9698349f7a42a0b8 (diff) | |
| download | puppet-c319fd059d2d563432700214d4946cf0bf925894.tar.gz puppet-c319fd059d2d563432700214d4946cf0bf925894.tar.xz puppet-c319fd059d2d563432700214d4946cf0bf925894.zip | |
Merge branch 'testing'
Diffstat (limited to 'test')
| -rwxr-xr-x | test/language/lexer.rb | 20 | ||||
| -rwxr-xr-x | test/language/parser.rb | 8 |
2 files changed, 27 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$ diff --git a/test/language/parser.rb b/test/language/parser.rb index 1cef72dcb..6f7599f27 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -653,6 +653,14 @@ file { "/tmp/yayness": } end + # #774 + def test_fully_qualified_collection_statement + parser = mkparser + assert_nothing_raised("Could not parse fully qualified collection statement") { + parser.parse %{Foo::Bar <||>} + } + end + def test_module_import basedir = File.join(tmpdir(), "module-import") @@tmpfiles << basedir |
