diff options
Diffstat (limited to 't/02-getting.t')
-rw-r--r-- | t/02-getting.t | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/t/02-getting.t b/t/02-getting.t index 8645607..adff4ff 100644 --- a/t/02-getting.t +++ b/t/02-getting.t @@ -8,7 +8,7 @@ plan 13; use Config; -my $config = Config.new(); +my Config $config = Config.new(); $config.read({ a => "a", @@ -17,19 +17,19 @@ $config.read({ } }); -ok $config.get("a") eq "a", "Get simple key"; -ok $config.get("b.c") eq "c", "Get nested key"; +is $config.get("a"), "a", "Get simple key"; +is $config.get("b.c"), "c", "Get nested key"; +is $config.get("nonexistant", "test"), "test", "Get nonexistant key with default"; ok $config.get("nonexistant") === Nil, "Get nonexistant key"; -ok $config.get("nonexistant", "test") === "test", "Get nonexistant key with default"; -ok $config.get(["a"]) eq "a", "Get simple key by array"; -ok $config.get(["b", "c"]) eq "c", "Get nested key by array"; +is $config.get(["a"]), "a", "Get simple key by array"; +is $config.get(["b", "c"]), "c", "Get nested key by array"; +is $config.get(["nonexistant"], "test"), "test", "Get nonexistant key by array with default"; ok $config.get(["nonexistant"]) === Nil, "Get nonexistant key by array"; -ok $config.get(["nonexistant"], "test") === "test", "Get nonexistant key by array with default"; -ok $config.<a> eq "a", "Get simple key via associative index"; -ok $config.<b.c> eq "c", "Get nested key via associative index"; +is $config.<a>, "a", "Get simple key via associative index"; +is $config.<b.c>, "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"; +ok $config.get(Nil) === Nil, "Attempt to .get with Nil key"; |