diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2008-10-16 20:24:30 +0200 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-10-21 09:32:28 +1100 |
| commit | e6f99f92ec5bfba973a3f13c629a8ce263a0da7d (patch) | |
| tree | 631bd56718c635f80d9f608bfd52cfbda914b63f /spec/unit/parser | |
| parent | a74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff) | |
| download | puppet-e6f99f92ec5bfba973a3f13c629a8ce263a0da7d.tar.gz puppet-e6f99f92ec5bfba973a3f13c629a8ce263a0da7d.tar.xz puppet-e6f99f92ec5bfba973a3f13c629a8ce263a0da7d.zip | |
Fix #636 - Allow extraneous comma in function argument list
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/parser.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/parser/parser.rb b/spec/unit/parser/parser.rb index c0d22a2cc..6ede8e6d1 100755 --- a/spec/unit/parser/parser.rb +++ b/spec/unit/parser/parser.rb @@ -142,4 +142,28 @@ describe Puppet::Parser do end + describe Puppet::Parser, "when parsing function calls" do + + it "should not raise errors with no arguments" do + lambda { @parser.parse("tag()") }.should_not raise_error + end + + it "should not raise errors with rvalue function with no args" do + lambda { @parser.parse("$a = template()") }.should_not raise_error + end + + it "should not raise errors with arguments" do + lambda { @parser.parse("notice(1)") }.should_not raise_error + end + + it "should not raise errors with multiple arguments" do + lambda { @parser.parse("notice(1,2)") }.should_not raise_error + end + + it "should not raise errors with multiple arguments and a trailing comma" do + lambda { @parser.parse("notice(1,2,)") }.should_not raise_error + end + + end + end |
