summaryrefslogtreecommitdiffabout
path: root/t/ConfigSpec.pm
Side-by-side diff
Diffstat (limited to 't/ConfigSpec.pm') (more/less context) (ignore whitespace changes)
-rw-r--r--t/ConfigSpec.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/ConfigSpec.pm b/t/ConfigSpec.pm
new file mode 100644
index 0000000..3963d83
--- a/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
+
+

Return to:

Send suggestions and report system problems to the System administrator.