summaryrefslogtreecommitdiffstats
path: root/test/language/ast.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 17:29:16 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-04 17:29:16 +0000
commit5d42cd51a3502518a5d0a22928a133768dcaeb1a (patch)
tree599b4ae12a957e141fc114364e5e342102045c9a /test/language/ast.rb
parentc8be52b7a9d95c1efcdb8df4ee88ae3f65c6f2df (diff)
downloadpuppet-5d42cd51a3502518a5d0a22928a133768dcaeb1a.tar.gz
puppet-5d42cd51a3502518a5d0a22928a133768dcaeb1a.tar.xz
puppet-5d42cd51a3502518a5d0a22928a133768dcaeb1a.zip
Fixing the class file to actually store class names, not object ids. Also added tests to make sure it all stays that way.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1063 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/ast.rb')
-rwxr-xr-xtest/language/ast.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/language/ast.rb b/test/language/ast.rb
index 441c7d892..a159f6eba 100755
--- a/test/language/ast.rb
+++ b/test/language/ast.rb
@@ -29,6 +29,7 @@ class TestAST < Test::Unit::TestCase
# Create child class two
children << classobj("child2", :parentclass => nameobj("parent"))
+ classes = %w{parent child1 child2}
# Now call the two classes
assert_nothing_raised("Could not add AST nodes for calling") {
@@ -60,6 +61,8 @@ class TestAST < Test::Unit::TestCase
assert_equal(1, scope.find_all { |child|
child.lookupobject(:name => "/parent", :type => "file")
}.length, "Found incorrect number of '/parent' objects")
+
+ assert_equal(classes.sort, scope.classlist.sort)
end
# Test that 'setobject' collects all of an object's parameters and stores
@@ -319,10 +322,12 @@ class TestAST < Test::Unit::TestCase
# Test that we can 'include' variables, not just normal strings.
def test_includevars
children = []
+ classes = []
# Create our class for testin
klassname = "include"
children << classobj(klassname)
+ classes << klassname
# Then add our variable assignment
children << varobj("klassvar", klassname)
@@ -345,6 +350,9 @@ class TestAST < Test::Unit::TestCase
top.evaluate(:scope => scope)
}
+ # Verify we get the right classlist back
+ assert_equal(classes.sort, scope.classlist.sort)
+
# Verify we can find the node via a search list
objects = nil
assert_nothing_raised("Could not retrieve objects") {