test/language/parser.rb in puppet-0.22.4 vs test/language/parser.rb in puppet-0.23.0

- old
+ new

@@ -395,19 +395,19 @@ class deep::sub inherits base {} }" } sub = interp.findclass("", "container::deep::sub") assert(sub, "Could not find sub") - assert_equal("base", sub.parentclass.type) + assert_equal("base", sub.parentobj.classname) # Now try it with a parent class being a fq class assert_nothing_raised { parser.parse "class container::one inherits container::deep::sub {}" } sub = interp.findclass("", "container::one") assert(sub, "Could not find one") - assert_equal("sub", sub.parentclass.type) + assert_equal("container::deep::sub", sub.parentobj.classname) # Finally, try including a qualified class assert_nothing_raised("Could not include fully qualified class") { parser.parse "include container::deep::sub" } @@ -429,11 +429,11 @@ # Now try something a touch more complicated parser.interp.clear assert_nothing_raised do out = parser.parse "Exec { path => '/usr/bin:/usr/sbin' }" assert_instance_of(AST::ASTArray, out) - assert_equal("", parser.interp.findclass("", "").type) + assert_equal("", parser.interp.findclass("", "").classname) assert_equal("", parser.interp.findclass("", "").namespace) assert_equal(out.object_id, parser.interp.findclass("", "").code.object_id) end end @@ -761,8 +761,21 @@ parser = mkparser assert_nothing_raised("Globbing failed when it matched a directory") do parser.import("%s/*" % dir) end end + + # #629 - undef keyword + def test_undef + parser = mkparser + result = nil + assert_nothing_raised("Could not parse assignment to undef") { + result = parser.parse %{$variable = undef} + } + + children = result.children + assert_instance_of(AST::VarDef, result.children[0]) + assert_instance_of(AST::Undef, result.children[0].value) + end end -# $Id: parser.rb 2404 2007-04-20 16:40:47Z luke $ +# $Id: parser.rb 2522 2007-05-17 21:43:51Z luke $