summaryrefslogtreecommitdiff
path: root/regress/cf/read_only.pl
blob: cf516a3d08b407ae7bdb32ee1412a30659338d43 (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
#!/usr/bin/env perl
#
# $FML: test.overload.pl,v 1.2 2002/04/18 14:18:09 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)';


# 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\)/) {
    print "ok\n";
}
else {
    print "fail\n";
}


# 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\)/) {
    print "ok\n";
}
else {
    print "fail\n";
    print $config->{ test }, "\n";
}

1;