aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-24 00:11:31 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-24 00:11:31 +0200
commit4719fa27d8a3de7e75162cdcc48c682e0c6affbc (patch)
tree9e48b90fb2acc9964f21a5db7b97afbe23a41a8d
parent852000b04805e0c12cc0552859311c5e9c884f69 (diff)
Add test descriptions
-rw-r--r--t/getting.t14
-rw-r--r--t/having.t4
-rw-r--r--t/setting.t4
3 files changed, 12 insertions, 10 deletions
diff --git a/t/getting.t b/t/getting.t
index 9d0cc5c..e4339bb 100644
--- a/t/getting.t
+++ b/t/getting.t
@@ -17,10 +17,12 @@ $config.read({
}
});
-ok $config.get("a") eq "a";
-ok $config.get("b.c") eq "c";
-ok $config.get("nonexistant") === Nil;
+ok $config.get("a") eq "a", "Get simple key";
+ok $config.get("b.c") eq "c", "Get nested key";
+ok $config.get("nonexistant") === Nil, "Get nonexistant key";
+ok $config.get("nonexistant", "test") === Nil, "Get nonexistant key with default";
-ok $config.get(["a"]) eq "a";
-ok $config.get(["b", "c"]) eq "c";
-ok $config.get(["nonexistant"]) === Nil;
+ok $config.get(["a"]) eq "a", "Get simple key by array";
+ok $config.get(["b", "c"]) eq "c", "Get nested key by array";
+ok $config.get(["nonexistant"]) === Nil, "Get nonexistant key by array";
+ok $config.get(["nonexistant"], "test") === Nil, "Get nonexistant key by array with default";
diff --git a/t/having.t b/t/having.t
index d0ca5b3..3be2935 100644
--- a/t/having.t
+++ b/t/having.t
@@ -17,5 +17,5 @@ $config.read({
}
});
-ok $config.has("a");
-ok $config.has("b.c");
+ok $config.has("a"), "Check existence of simple key";
+ok $config.has("b.c"), "Check existence of nested key";
diff --git a/t/setting.t b/t/setting.t
index 3e36271..d9f0854 100644
--- a/t/setting.t
+++ b/t/setting.t
@@ -10,5 +10,5 @@ use Config;
my $config = Config.new();
-ok $config.set("a", "test").get("a") eq "test";
-ok $config.set("b.c", "test").get("b.c") eq "test";
+ok $config.set("a", "test").get("a") eq "test", "Setting simple key";
+ok $config.set("b.c", "test").get("b.c") eq "test", "Setting nested key";