aboutsummaryrefslogtreecommitdiff
path: root/t/conf02.t
diff options
context:
space:
mode:
Diffstat (limited to 't/conf02.t')
-rw-r--r--t/conf02.t45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/conf02.t b/t/conf02.t
new file mode 100644
index 0000000..9447060
--- /dev/null
+++ b/t/conf02.t
@@ -0,0 +1,45 @@
+# -*- perl -*-
+use lib 't';
+use strict;
+use Test;
+use TestConfig;
+
+plan(tests => 7);
+
+my %keywords = (
+ core => {
+ section => {
+ 'retain-interval' => { mandatory => 1 },
+ 'tempdir' => 1,
+ 'verbose' => 1,
+ }
+ },
+ backend => {
+ section => {
+ file => 1
+ }
+ }
+);
+
+my $cfg = new TestConfig(parameters => \%keywords);
+ok($cfg->isset('backend','foo','file'));
+ok($cfg->isscalar('backend','foo','file'));
+ok($cfg->get('backend','foo','file'), 'foo');
+
+ok($cfg->isset('core', 'verbose') == 0);
+
+ok($cfg->issection('backend','foo'));
+
+$cfg->set('core','verbose','On');
+ok($cfg->get('core','verbose'),'On');
+
+$cfg->unset('core','tmpdir');
+ok($cfg->isset('core','tmpdir') == 0);
+
+__DATA__
+# This is a sample configuration file
+[core]
+ retain-interval = 10
+ tempdir = /tmp
+[backend foo]
+ file = foo

Return to:

Send suggestions and report system problems to the System administrator.