~ubuntu-branches/ubuntu/natty/libconfig-inifiles-perl/natty-updates

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
#!/usr/bin/perl

# This script attempts to reproduce:
# https://rt.cpan.org/Ticket/Display.html?id=36309 

use strict;
use warnings;

use Test::More tests => 1;
use File::Spec;

use Config::IniFiles;

my $filename = File::Spec->catfile(
    File::Spec->curdir(), "t", "allowed-comment-chars.ini",
);

{
    my $cfg = 
        Config::IniFiles->new(
            -file => $filename, 
            -allowedcommentchars => '};',
        );

    # TEST
    is ($cfg->val("cat1", "mykey"),
        "500",
        "Proper comments are ignored.",
    );
}