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
|
# -*- perl -*-
use lib qw(t lib);
use strict;
use Test;
use TestConfig;
use Data::Dumper;
plan(tests => 1);
my $t = new TestConfig(
config => [
base => '/etc',
'core.file' => 'passwd',
'core.home' => '/home',
'file.passwd.mode' => '0644',
'file.passwd.root.uid' => 0,
'file.passwd.root.dir' => '/root',
'core.group' => 'group'
]);
print $t->canonical,"\n";
ok(Data::Dumper->new([$t->as_hash])
->Sortkeys(1)
->Useqq(1)
->Terse(1)
->Indent(0)
->Dump,
'{"base" => "/etc","core" => {"file" => "passwd","group" => "group","home" => "/home"},"file" => {"passwd" => {"mode" => "0644","root" => {"dir" => "/root","uid" => 0}}}}');
|