summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-25 14:11:14 -0500
committerLuke Kanies <luke@madstop.com>2007-09-25 14:11:14 -0500
commit8ec60118684fc32b65ce70ccfc009e07b7e6a3cd (patch)
treef6e2b1adcbefb25672ef7cc8b9070d654978dac0 /test
parent2e3306143b1f58765f48911ba433a119de323b84 (diff)
parentab1b0344da8faf8d94a363ba4a64e0238845828a (diff)
downloadpuppet-8ec60118684fc32b65ce70ccfc009e07b7e6a3cd.tar.gz
puppet-8ec60118684fc32b65ce70ccfc009e07b7e6a3cd.tar.xz
puppet-8ec60118684fc32b65ce70ccfc009e07b7e6a3cd.zip
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet into indirection
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/lexer.rb20
-rwxr-xr-xtest/language/parser.rb8
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