summaryrefslogtreecommitdiff
path: root/t/01-read.t
blob: 5c150876678082ce5aa07c0118221a5dab506088 (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
27
28
29
30
31
32
#! /usr/bin/env perl6

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

use Config;

plan 4;

my $config = Config.new();

ok $config.read('t/files/config.toml'.IO), "File reading throws no error";

subtest "Contents match" => {
    plan 2;

    is $config.get("header.a"), "a", "a = a";
    is $config.get("header.b"), "b", "b = b";
};

ok $config.=read('t/files/merge.toml'.IO), "File merging throws no error";

subtest "Contents match after merging" => {
    plan 4;

    is $config.get("header.a"), "a", "a = a";
    is $config.get("header.b"), "b", "b = b";
    is $config.get("header.c"), "c", "c = c";

    is $config.get("merge-header.a"), "a", "a = a";
};