aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-07-29 02:54:19 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-07-29 02:54:19 +0200
commit3da0c917a5985db827f33988d6d74e16abd34439 (patch)
tree70fe06e4d9f64f86674e1bc677aef2787981c014
parent88425ea8064b579d47d6b8c63906612f1aceeef8 (diff)
Add tests for using .get with a Nil key
-rw-r--r--t/02-getting.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/02-getting.t b/t/02-getting.t
index de7689a..8645607 100644
--- a/t/02-getting.t
+++ b/t/02-getting.t
@@ -4,7 +4,7 @@ use v6.c;
use Test;
use lib "lib";
-plan 11;
+plan 13;
use Config;
@@ -30,3 +30,6 @@ ok $config.get(["nonexistant"], "test") === "test", "Get nonexistant key by arra
ok $config.<a> eq "a", "Get simple key via associative index";
ok $config.<b.c> eq "c", "Get nested key via associative index";
ok $config.<nonexistant> === Nil, "Get nonexistant key via associative index";
+
+is $config.get(Nil), Nil, "Attempt to .get with Nil key";
+is $config.get(Nil, "test"), "test", "Attempt .get with Nil key with default";