summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-10-22 18:30:57 -0500
committerLuke Kanies <luke@madstop.com>2008-10-22 18:30:57 -0500
commit801b8a643d353176675023adaa25f26d0ec67403 (patch)
tree10f93a48f33b426776797047c49db2948a0c2df9 /test
parent9742c26310e6b30095651cb4e224c681603af1ff (diff)
parentb2c1149b5f374df77ad3e017749f22f6981a453f (diff)
downloadpuppet-801b8a643d353176675023adaa25f26d0ec67403.tar.gz
puppet-801b8a643d353176675023adaa25f26d0ec67403.tar.xz
puppet-801b8a643d353176675023adaa25f26d0ec67403.zip
Merge branch '0.24.x'
Conflicts: lib/puppet/type/user.rb
Diffstat (limited to 'test')
-rw-r--r--test/data/snippets/arraytrailingcomma.pp3
-rw-r--r--test/data/snippets/funccomma.pp5
-rwxr-xr-xtest/language/parser.rb13
-rwxr-xr-xtest/language/snippets.rb14
4 files changed, 35 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/data/snippets/funccomma.pp b/test/data/snippets/funccomma.pp
new file mode 100644
index 000000000..32e34f92e
--- /dev/null
+++ b/test/data/snippets/funccomma.pp
@@ -0,0 +1,5 @@
+@file {
+ ["/tmp/funccomma1","/tmp/funccomma2"]: content => "1"
+}
+
+realize( File["/tmp/funccomma1"], File["/tmp/funccomma2"] , )
diff --git a/test/language/parser.rb b/test/language/parser.rb
index b1a0de3cf..30baea49f 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -56,6 +56,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 95a518388..069f7aced 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -445,6 +445,20 @@ class TestSnippets < Test::Unit::TestCase
"Did not make second file from duplicate subclass names")
end
+ def snippet_funccomma
+ assert_file("/tmp/funccomma1",
+ "Did not make first file from trailing function comma")
+ assert_file("/tmp/funccomma2",
+ "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 =~ /^\./