aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/ConfigSpec.pm5
-rw-r--r--t/ConfigSpec2.pm10
-rw-r--r--t/conf06.t14
-rw-r--r--t/conf07.t18
4 files changed, 43 insertions, 4 deletions
diff --git a/t/ConfigSpec.pm b/t/ConfigSpec.pm
index 3963d83..30812ed 100644
--- a/t/ConfigSpec.pm
+++ b/t/ConfigSpec.pm
@@ -15,11 +15,8 @@ __DATA__
[core]
base = STRING :mandatory null
number = NUMBER :array
size = STRING :re='\d+(?:(?i) *[kmg])'
[load]
file = STRING :check=_check_abs_name :mandatory
-[load ANY param:mandatory]
- mode = OCTAL
- owner = STRING
-
+ ANY = STRING
diff --git a/t/ConfigSpec2.pm b/t/ConfigSpec2.pm
new file mode 100644
index 0000000..0a56cd6
--- /dev/null
+++ b/t/ConfigSpec2.pm
@@ -0,0 +1,10 @@
+package ConfigSpec2;
+use parent 'TestConfig';
+
+1;
+__DATA__
+[core]
+ base = STRING :mandatory null
+[load ANY param:mandatory]
+ mode = OCTAL
+ owner = STRING
diff --git a/t/conf06.t b/t/conf06.t
new file mode 100644
index 0000000..69756dc
--- /dev/null
+++ b/t/conf06.t
@@ -0,0 +1,14 @@
+# -*- perl -*-
+use lib qw(t lib);
+use strict;
+use Test;
+use ConfigSpec2;
+
+plan(tests => 1);
+
+my $c = new ConfigSpec2(expect => ['mandatory section [load * param] not present']);
+ok($c->errors, 1);
+
+__DATA__
+[core]
+ base = test
diff --git a/t/conf07.t b/t/conf07.t
new file mode 100644
index 0000000..808ff2c
--- /dev/null
+++ b/t/conf07.t
@@ -0,0 +1,18 @@
+# -*- perl -*-
+use lib qw(t lib);
+use strict;
+use Test;
+use ConfigSpec2;
+
+plan(tests => 1);
+
+my $c = new ConfigSpec2;
+ok($c->canonical,
+ q{core.base="test" load.test.param.mode="0644" load.test.param.owner="nobody"});
+
+__DATA__
+[core]
+ base = test
+[load test param]
+ mode = 0644
+ owner = nobody

Return to:

Send suggestions and report system problems to the System administrator.