File: v2_04_parameters.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 (29 lines) | stat: -rw-r--r-- 630 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
#!/usr/bin/perl -T
# 04_parameters.t

use Test::More tests => 8;
use Paranoid;
use Parse::PlainConfig::Legacy;

use strict;
use warnings;

psecureEnv();

my $testrc = "./t/v2_testrc";
my $conf   = Parse::PlainConfig::Legacy->new(FILE => $testrc);
my @test   = ("SCALAR 1", "SCALAR 2", "SCALAR 3", "LIST 1", "LIST 2",
              "HASH 1");
my (@params, $p);

# 1 Make sure parameters have been read
ok( $conf->read, 'read 1');
@params = $conf->parameters;
is( scalar(@params), 10, '# of parameters read' );

foreach my $t (@test) {
    ($p) = grep /^\Q$t\E$/, @params;
    is( $p, $t, "parameter $t" );
}

# end 04_parameters.t