File: v2_15_defaults.t

package info (click to toggle)
libparse-plainconfig-perl 3.07-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: perl: 1,916; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 15_defaults.t
#
# Test the defaults capability

use Parse::PlainConfig::Legacy;

$|++;
print "1..2\n";

my $test    = 1;
my $conf    = new Parse::PlainConfig::Legacy;
my $testrc  = "./t/v2_testrc";
my ($val, $val2);
$conf->read($testrc);
$conf->property(DEFAULTS => 
  {
  NOT_PRESENT   => 1,
  });

# 1 Test defaults
$val = $conf->parameter('NOT_PRESENT');
$val == 1 ? print "ok $test\n" : print "not ok $test\n";
$test++;

# 2 Test present key
$val = $conf->parameter('SCALAR 1');
$val eq 'value1' ? print "ok $test\n" : print "not ok $test\n";
$test++;

# end 15_defaults.t