aboutsummaryrefslogtreecommitdiff
path: root/t/ConfigSpec.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/ConfigSpec.pm')
-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
--- /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.