diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/data/snippets/arraytrailingcomma.pp | 3 | ||||
| -rwxr-xr-x | test/language/parser.rb | 13 | ||||
| -rwxr-xr-x | test/language/snippets.rb | 7 |
3 files changed, 23 insertions, 0 deletions
diff --git a/test/data/snippets/arraytrailingcomma.pp b/test/data/snippets/arraytrailingcomma.pp new file mode 100644 index 000000000..a410f9553 --- /dev/null +++ b/test/data/snippets/arraytrailingcomma.pp @@ -0,0 +1,3 @@ +file { + ["/tmp/arraytrailingcomma1","/tmp/arraytrailingcomma2", ]: content => "tmp" +} diff --git a/test/language/parser.rb b/test/language/parser.rb index fc8452b87..2453bdf3c 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -66,6 +66,19 @@ class TestParser < Test::Unit::TestCase } end + def test_arrayrvalueswithtrailingcomma + parser = mkparser + ret = nil + file = tempfile() + assert_nothing_raised { + parser.string = "file { \"#{file}\": mode => [755, 640,] }" + } + + assert_nothing_raised { + ret = parser.parse + } + end + def mkmanifest(file) name = File.join(tmpdir, "file%s" % rand(100)) @@tmpfiles << name diff --git a/test/language/snippets.rb b/test/language/snippets.rb index 5ea436d40..ebc977388 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -453,6 +453,13 @@ class TestSnippets < Test::Unit::TestCase "Did not make second file from trailing function comma") end + def snippet_arraytrailingcomma + assert_file("/tmp/arraytrailingcomma1", + "Did not make first file from array") + assert_file("/tmp/arraytrailingcomma2", + "Did not make second file from array") + end + # Iterate across each of the snippets and create a test. Dir.entries(snippetdir).sort.each { |file| next if file =~ /^\./ |
