summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-08 17:13:19 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-08 17:13:19 +0000
commit60e5e10ef51f9eed05e7fbeff6866668311de181 (patch)
treef7b8cf26dcfa47039044cca5bf0bd7c7f6c568e7
parent266d37d3889d93929f77e825fc288b2b57f1001f (diff)
downloadpuppet-60e5e10ef51f9eed05e7fbeff6866668311de181.tar.gz
puppet-60e5e10ef51f9eed05e7fbeff6866668311de181.tar.xz
puppet-60e5e10ef51f9eed05e7fbeff6866668311de181.zip
Applying further tests to double-quoted hostnames by Valentin Vidic
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2657 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xtest/language/node.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/language/node.rb b/test/language/node.rb
index 94f5ba39f..68459d141 100755
--- a/test/language/node.rb
+++ b/test/language/node.rb
@@ -17,16 +17,26 @@ class TestParser < Test::Unit::TestCase
def test_simple_hostname
check_parseable "host1"
check_parseable "'host2'"
+ check_parseable "\"host3\""
check_parseable [ "'host1'", "host2" ]
check_parseable [ "'host1'", "'host2'" ]
+ check_parseable [ "'host1'", "\"host2\"" ]
+ check_parseable [ "\"host1\"", "host2" ]
+ check_parseable [ "\"host1\"", "'host2'" ]
+ check_parseable [ "\"host1\"", "\"host2\"" ]
end
def test_qualified_hostname
check_parseable "'host.example.com'"
+ check_parseable "\"host.example.com\""
check_parseable [ "'host.example.com'", "host1" ]
+ check_parseable [ "\"host.example.com\"", "host1" ]
check_parseable "'host-1.37examples.example.com'"
+ check_parseable "\"host-1.37examples.example.com\""
check_parseable "'svn.23.nu'"
+ check_parseable "\"svn.23.nu\""
check_parseable "'HOST'"
+ check_parseable "\"HOST\""
end
def test_inherits_from_default
@@ -37,7 +47,9 @@ class TestParser < Test::Unit::TestCase
check_nonparseable "host.example.com"
check_nonparseable "host@example.com"
check_nonparseable "'$foo.example.com'"
+ check_nonparseable "\"$foo.example.com\""
check_nonparseable "'host1 host2'"
+ check_nonparseable "\"host1 host2\""
check_nonparseable "HOST"
end
@@ -53,7 +65,7 @@ class TestParser < Test::Unit::TestCase
interp = mkinterp :Code => code
}
# Strip quotes
- hostnames.map! { |s| s.sub(/^'(.*)'$/, "\\1") }
+ hostnames.map! { |s| s.sub(/^['"](.*)['"]$/, "\\1") }
# parse
assert_nothing_raised {