aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2018-03-20 14:40:00 +0100
committerPatrick Spek <p.spek@tyil.nl>2018-03-20 14:40:00 +0100
commitfe7e117ee12678095ddbdc7b68907e8b9ad48ae6 (patch)
treeddb309488457f29a3f456da6d0df0bdd82e88503 /t
parent681dfeb2dbfb280406dcf4be6a2d80a3c39ccefb (diff)
Fix :delete adverb
Diffstat (limited to 't')
-rw-r--r--t/08-unsetting.t.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/08-unsetting.t.t b/t/08-unsetting.t.t
new file mode 100644
index 0000000..8837989
--- /dev/null
+++ b/t/08-unsetting.t.t
@@ -0,0 +1,30 @@
+#! /usr/bin/env perl6
+
+use v6.c;
+use Test;
+use lib "lib";
+
+plan 8;
+
+use Config;
+
+my $config = Config.new;
+
+$config.read: %(
+ a => "b",
+ c => %(
+ d => "e",
+ ),
+);
+
+dd $config.get();
+
+ok $config<a>:exists, "'a' exists";
+ok $config<a>:delete, "'a' gets deleted";
+nok $config<a>:exists, "'a' no longer exists";
+ok $config<c>:exists, "'c' remains untouched";
+
+ok $config.has("c.d"), "'c.d' exists";
+ok $config.unset("c.d"), "'c.d' gets deleted";
+nok $config.has("c.d"), "'c.d' no longer exists";
+ok $config.has("c"), "'c' still exists";