From e3c59df2b246fe5e764272f21b631a5d2f28687f Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Thu, 17 Feb 2011 13:52:40 -0800 Subject: (#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 --- spec/integration/parser/parser_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/integration/parser/parser_spec.rb') 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 -- cgit