File: 07.trailing.comment.t

package info (click to toggle)
libconfig-tiny-perl 2.30-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 208 kB
  • sloc: perl: 394; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use Config::Tiny;

use Test::More tests => 4;

# ------------------------

my($source1) = 'One ; Two';
my($source2) = 'One;Two';
my($source3) = 'One; Two';

my($string) = <<EOS;
key1 = $source1
key2 = $source2
key3 = $source3
EOS

my($config) = Config::Tiny -> read_string($string);

isa_ok($config, 'Config::Tiny', 'read_string() returns an object');
ok($$config{_}{key1} eq 'One', "Source '$source1' read correctly as '$$config{_}{key1}'");
ok($$config{_}{key2} eq 'One;Two', "Source '$source2' read correctly as '$$config{_}{key2}'");
ok($$config{_}{key3} eq 'One; Two', "Source '$source3' read correctly as '$$config{_}{key3}'");