summaryrefslogtreecommitdiff
path: root/regress/cf/read_only.pl
blob: 1177e31b6e8815d8ffacc6b02532e48390b7fcd8 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env perl
#
# $FML: read_only.pl,v 1.1 2002/07/22 09:38:40 fukachan Exp $
#

use strict;
use Carp;
use lib qw(../../fml/lib ../../cpan/lib);
use FML::Config;

my $debug  = defined $ENV{'debug'} ? 1 : 0;
my $value  = 'a	b c READ_ONLY($map)';

use FML::Test::Utils;
my $tool = new FML::Test::Utils;
$tool->set_title("config.cf READ_ONLY");

# test 1: 
#         READ_ONLY(x y) -> READ_ONLY(x) READ_ONLY(y)
#
my $config = new FML::Config;
$config->set( 'map',  'x y' );
$config->set( 'test', $value );
if ( $config->{ test } =~ /READ_ONLY\(x\)\s+READ_ONLY\(y\)/) {
    $tool->print_ok();
}
else {
    $tool->print_error();
}


# test 2: 
#         READ_ONLY(x y z) -> READ_ONLY(x) READ_ONLY(y) READ_ONLY(z)
#
my $config = new FML::Config;
$config->set( 'map',  'x y z' );
$config->set( 'test', $value );
if ( $config->{ test } =~ /READ_ONLY\(x\)\s+READ_ONLY\(y\)\s+READ_ONLY\(z\)/) {
    $tool->print_ok();
}
else {
    $tool->print_error($config->{ test });
}

1;