summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-02-17 13:52:40 -0800
committerNick Lewis <nick@puppetlabs.com>2011-02-17 13:52:40 -0800
commite3c59df2b246fe5e764272f21b631a5d2f28687f (patch)
tree1f0e312846e8042895caec1737fe600e0ae09352 /spec/integration
parentab1126e1c5931833299f06cb5977b1ca2d0badd0 (diff)
downloadpuppet-e3c59df2b246fe5e764272f21b631a5d2f28687f.tar.gz
puppet-e3c59df2b246fe5e764272f21b631a5d2f28687f.tar.xz
puppet-e3c59df2b246fe5e764272f21b631a5d2f28687f.zip
(#5935) Allow functions to accept negated values
function(-1) was failing because the grammar wasn't allowing negated values in function calls. This fix makes the negation of any value which was previously legal as a function argument also now legal as a function argument. Paired-With: Max Martin Paired-With: Markus Roberts
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/parser/parser_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb
index 20d87c228..000e68dd8 100755
--- a/spec/integration/parser/parser_spec.rb
+++ b/spec/integration/parser/parser_spec.rb
@@ -116,5 +116,18 @@ describe Puppet::Parser::Parser do
$out = $hash['a']['b']['c']
}.should parse_with { |v| v.value.is_a?(Puppet::Parser::AST::ASTHash) }
end
+
+ it "should be able to pass numbers to functions" do
+ %q{
+ my_function(1)
+ }.should parse_as(Puppet::Parser::AST::Function)
+ end
+
+ it "should be able to pass negative numbers to functions" do
+ %q{
+ my_function(-1)
+ }.should parse_as(Puppet::Parser::AST::Function)
+ end
+
end
end