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 @@ +package ConfigSpec; +use parent 'TestConfig'; + +sub _check_abs_name { + my ($self, $valref, $prev_value, $locus) = @_; + unless ($$valref =~ m{^/}) { + $self->error("not an absolute pathname", locus => $locus); + return 0; + } + 1; +} + +1; +__DATA__ +[core] + base = STRING :mandatory null + number = NUMBER :array + size = STRING :re='\d+(?:(?i) *[kmg])' +[load] + file = STRING :check=_check_abs_name :mandatory +[load ANY param:mandatory] + mode = OCTAL + owner = STRING + + |