summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-01 00:58:11 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-01 00:58:11 +0000
commit18eebaf87e14db77dce9114078501efe7392fba4 (patch)
tree121754aaf560280d1b792bfb508c28bd171f0364
parenta3a85d870c51d563d380b33b09b37d5fd144cd5f (diff)
downloadpuppet-18eebaf87e14db77dce9114078501efe7392fba4.tar.gz
puppet-18eebaf87e14db77dce9114078501efe7392fba4.tar.xz
puppet-18eebaf87e14db77dce9114078501efe7392fba4.zip
Fixing selector tests to get rid of a lame hash ordering bug in the tests.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2142 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/parser/ast/selector.rb1
-rwxr-xr-xtest/language/ast/selector.rb7
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/puppet/parser/ast/selector.rb b/lib/puppet/parser/ast/selector.rb
index 7ba020c8e..f3d684a3d 100644
--- a/lib/puppet/parser/ast/selector.rb
+++ b/lib/puppet/parser/ast/selector.rb
@@ -43,6 +43,7 @@ class Puppet::Parser::AST
found = true
break
elsif obj.param.is_a?(Default)
+ # Store the default, in case it's necessary.
default = obj
end
}
diff --git a/test/language/ast/selector.rb b/test/language/ast/selector.rb
index ba21f616e..c7dfeb2fe 100755
--- a/test/language/ast/selector.rb
+++ b/test/language/ast/selector.rb
@@ -47,13 +47,16 @@ class TestSelector < Test::Unit::TestCase
%w{MYPARAM myparam}.each do |str|
param = nameobj(str)
params = maker.call()
+
+ # Delete the upper value, since we don't want it to match
+ # and it introduces a hash-ordering bug in testing.
+ params.delete(:upper)
sel = AST::Selector.new(:param => param, :values => params.values)
result = nil
assert_nothing_raised { result = sel.evaluate(:scope => scope) }
assert_equal("lower", result, "did not case-insensitively match %s" % str)
end
-
end
end
-# $Id$ \ No newline at end of file
+# $Id$