summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2018-01-20 22:38:16 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2018-01-20 22:38:16 (GMT)
commiteda00b0eaa069d5631efec255ef162b695d73d33 (patch) (side-by-side diff)
tree4c6f3b9a52b5423efb1d41ce644ae3507685299b
parente406653af5ae596d2d6f212f6ebaf66bcfe5dbf1 (diff)
downloadconfig-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.gz
config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.bz2
Reflect recent changes to Config::Tree
Diffstat (more/less context) (ignore whitespace changes)
-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
@@ -18,8 +18,5 @@ __DATA__
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
--- a/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
--- a/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
--- a/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.