File: 09_force_scalar.t

package info (click to toggle)
libparse-plainconfig-perl 1.7a%2Bpristine-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 140 kB
  • ctags: 18
  • sloc: perl: 264; makefile: 43
file content (23 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 09_force_scalar.t
#
# Tests for proper operation of the force scalar directive

$|++;
print "1..2\n";
my $test = 1;
my $rcfile = './t/testrc2';

# 1 Load
use Parse::PlainConfig;
my $new = Parse::PlainConfig->new('DELIM' => '=', 
  'FORCE_SCALAR' => [ 'LIST 1', 'LIST 2' ]);
ref $new ? print "ok $test\n" : print "not ok $test\n";
$test++;

# 2 Make sure the list was returned as a scalar
$new->read($rcfile);
$new->get('LIST 1') eq 'value1, value2, value3' ?  print "ok $test\n" : 
  print "not ok $test\n";
$test++;

# end 09_force_scalar.t