Debian Codegraph @

t/24case-sensitive-exists.t

raw symbols SCIP
1 #!/usr/bin/perl
2
3 # This script attempts to reproduce:
4 # https://rt.cpan.org/Ticket/Display.html?id=46721
5 #
6 # #46721: $config->exists() does not pay attention to -nocase => 1
7
8 use Test::More tests => 2;
9
10 use strict;
11 use warnings;
12
13 use File::Spec;
14
15 use Config::IniFiles;
16
17 {
18 my $conf = Config::IniFiles->new(
19 -file => File::Spec->catfile(
20 File::Spec->curdir(), 't', 'case-sensitive.ini'
21 ),
22 -nocase => 1
23 );
24
25 # TEST
26 ok(
27 scalar( $conf->exists( 'FOO', 'BAR' ) ),
28 "->exists() Handles case well"
29 );
30
31 # TEST
32 is( scalar( $conf->val( 'FOO', 'BAR' ) ),
33 "goodness", "->val() Handles case well" );
34 }
35