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 /t | |
parent | e406653af5ae596d2d6f212f6ebaf66bcfe5dbf1 (diff) | |
download | config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.gz config-parser-eda00b0eaa069d5631efec255ef162b695d73d33.tar.bz2 |
Reflect recent changes to Config::Tree
Diffstat (limited to 't')
-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__ 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 |