aboutsummaryrefslogtreecommitdiff
path: root/t/getting.t
blob: 9d0cc5c1aba9b1502e66fdb99a68d81142ce61ea (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
#! /usr/bin/env perl6

use v6.c;
use Test;
use lib "lib";

plan 6;

use Config;

my $config = Config.new();

$config.read({
    a => "a",
    b => {
        c => "c"
    }
});

ok $config.get("a") eq "a";
ok $config.get("b.c") eq "c";
ok $config.get("nonexistant") === Nil;

ok $config.get(["a"]) eq "a";
ok $config.get(["b", "c"]) eq "c";
ok $config.get(["nonexistant"]) === Nil;