diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-01-20 23:38:16 +0100 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-01-20 23:38:16 +0100 |
commit | eda00b0eaa069d5631efec255ef162b695d73d33 (patch) | |
tree | 4c6f3b9a52b5423efb1d41ce644ae3507685299b | |
parent | e406653af5ae596d2d6f212f6ebaf66bcfe5dbf1 (diff) | |
download | config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.gz config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.bz2 |
Reflect recent changes to Config::Tree
-rw-r--r-- | t/ConfigSpec.pm | 5 | ||||
-rw-r--r-- | t/ConfigSpec2.pm | 10 | ||||
-rw-r--r-- | t/conf06.t | 14 | ||||
-rw-r--r-- | t/conf07.t | 18 |
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 @@ | |||
1 | package ConfigSpec2; | ||
2 | use parent 'TestConfig'; | ||
3 | |||
4 | 1; | ||
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 -*- | ||
2 | use lib qw(t lib); | ||
3 | use strict; | ||
4 | use Test; | ||
5 | use ConfigSpec2; | ||
6 | |||
7 | plan(tests => 1); | ||
8 | |||
9 | my $c = new ConfigSpec2(expect => ['mandatory section [load * param] not present']); | ||
10 | ok($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 -*- | ||
2 | use lib qw(t lib); | ||
3 | use strict; | ||
4 | use Test; | ||
5 | use ConfigSpec2; | ||
6 | |||
7 | plan(tests => 1); | ||
8 | |||
9 | my $c = new ConfigSpec2; | ||
10 | ok($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 | ||