aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2018-01-20 23:38:16 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2018-01-20 23:38:16 +0100
commiteda00b0eaa069d5631efec255ef162b695d73d33 (patch)
tree4c6f3b9a52b5423efb1d41ce644ae3507685299b
parente406653af5ae596d2d6f212f6ebaf66bcfe5dbf1 (diff)
downloadconfig-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.gz
config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.bz2
Reflect recent changes to Config::Tree
-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__
18 size = STRING :re='\d+(?:(?i) *[kmg])' 18 size = STRING :re='\d+(?:(?i) *[kmg])'
19[load] 19[load]
20 file = STRING :check=_check_abs_name :mandatory 20 file = STRING :check=_check_abs_name :mandatory
21[load ANY param:mandatory] 21 ANY = STRING
22 mode = OCTAL
23 owner = STRING
24
25 22
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 @@
1package ConfigSpec2;
2use parent 'TestConfig';
3
41;
5__DATA__
6[core]
7 base = STRING :mandatory null
8[load ANY param:mandatory]
9 mode = OCTAL
10 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 @@
1# -*- perl -*-
2use lib qw(t lib);
3use strict;
4use Test;
5use ConfigSpec2;
6
7plan(tests => 1);
8
9my $c = new ConfigSpec2(expect => ['mandatory section [load * param] not present']);
10ok($c->errors, 1);
11
12__DATA__
13[core]
14 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 @@
1# -*- perl -*-
2use lib qw(t lib);
3use strict;
4use Test;
5use ConfigSpec2;
6
7plan(tests => 1);
8
9my $c = new ConfigSpec2;
10ok($c->canonical,
11 q{core.base="test" load.test.param.mode="0644" load.test.param.owner="nobody"});
12
13__DATA__
14[core]
15 base = test
16[load test param]
17 mode = 0644
18 owner = nobody

Return to:

Send suggestions and report system problems to the System administrator.