From d53cd8d297d5083833b9e962b238a3e3fe9ef7f0 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Mon, 24 Apr 2017 00:11:31 +0200 Subject: Add test descriptions --- t/getting.t | 14 ++++++++------ t/having.t | 4 ++-- t/setting.t | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 't') 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"; -- cgit v1.1