aboutsummaryrefslogtreecommitdiff
path: root/t/01-read.t
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-27 14:53:13 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-27 14:53:13 +0200
commitb366ef7066f63df2e19bd93e34de202f34a1c282 (patch)
treeb05a1017ca725e6d8f429836f6d76a3e7085ec42 /t/01-read.t
Initial commit
Diffstat (limited to 't/01-read.t')
-rw-r--r--t/01-read.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/01-read.t b/t/01-read.t
new file mode 100644
index 0000000..fa5a75b
--- /dev/null
+++ b/t/01-read.t
@@ -0,0 +1,33 @@
+#! /usr/bin/env perl6
+
+use v6.c;
+use Test;
+use lib "lib";
+
+use Config;
+use Config::Parser::toml;
+
+plan 4;
+
+my $config = Config.new();
+
+ok $config.read("t/files/config.toml"), "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"), "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";
+};