diff options
Diffstat (limited to 't/ConfigSpec.pm')
-rw-r--r-- | t/ConfigSpec.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/ConfigSpec.pm b/t/ConfigSpec.pm new file mode 100644 index 0000000..3963d83 --- /dev/null +++ b/t/ConfigSpec.pm | |||
@@ -0,0 +1,25 @@ | |||
1 | package ConfigSpec; | ||
2 | use parent 'TestConfig'; | ||
3 | |||
4 | sub _check_abs_name { | ||
5 | my ($self, $valref, $prev_value, $locus) = @_; | ||
6 | unless ($$valref =~ m{^/}) { | ||
7 | $self->error("not an absolute pathname", locus => $locus); | ||
8 | return 0; | ||
9 | } | ||
10 | 1; | ||
11 | } | ||
12 | |||
13 | 1; | ||
14 | __DATA__ | ||
15 | [core] | ||
16 | base = STRING :mandatory null | ||
17 | number = NUMBER :array | ||
18 | size = STRING :re='\d+(?:(?i) *[kmg])' | ||
19 | [load] | ||
20 | file = STRING :check=_check_abs_name :mandatory | ||
21 | [load ANY param:mandatory] | ||
22 | mode = OCTAL | ||
23 | owner = STRING | ||
24 | |||
25 | |||