aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-07-29 03:04:12 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-07-29 03:04:12 +0200
commitcfe2b133a952945c24879118fc5f0aed16c3c0cf (patch)
tree3dd5a63fe8bbd1d747b387e97bcbac8916924df6
parent3da0c917a5985db827f33988d6d74e16abd34439 (diff)
Clean up all tests
-rw-r--r--t/01-reading.t2
-rw-r--r--t/02-getting.t20
-rw-r--r--t/03-having.t2
-rw-r--r--t/04-setting.t8
-rw-r--r--t/05-null-parser.t2
-rw-r--r--t/06-deduce-parser.t2
6 files changed, 18 insertions, 18 deletions
diff --git a/t/01-reading.t b/t/01-reading.t
index 07e92c3..f7bf7d4 100644
--- a/t/01-reading.t
+++ b/t/01-reading.t
@@ -8,7 +8,7 @@ plan 5;
use Config;
-my $config = Config.new();
+my Config $config = Config.new();
throws-like { $config.read("t/files/none") }, Config::Exception::FileNotFoundException, "Reading nonexisting file";
throws-like { $config.read("t/files/config", "Config::Parser:NoSuchParserForTest") }, Config::Exception::MissingParserException, "Using non-existing parser";
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";
diff --git a/t/03-having.t b/t/03-having.t
index 0627ed5..3708d8e 100644
--- a/t/03-having.t
+++ b/t/03-having.t
@@ -8,7 +8,7 @@ plan 4;
use Config;
-my $config = Config.new();
+my Config $config = Config.new();
$config.read({
a => "a",
diff --git a/t/04-setting.t b/t/04-setting.t
index 7e3a457..77039ca 100644
--- a/t/04-setting.t
+++ b/t/04-setting.t
@@ -10,7 +10,7 @@ use Config;
my $config = Config.new();
-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";
-ok $config.set(["d"], "test").get("d") eq "test", "Setting simple key using array";
-ok $config.set(["e", "f"], "test").get("e.f") eq "test", "Setting nested key using array";
+is $config.set("a", "test").get("a"), "test", "Setting simple key";
+is $config.set("b.c", "test").get("b.c"), "test", "Setting nested key";
+is $config.set(["d"], "test").get("d"), "test", "Setting simple key using array";
+is $config.set(["e", "f"], "test").get("e.f"), "test", "Setting nested key using array";
diff --git a/t/05-null-parser.t b/t/05-null-parser.t
index 97e897f..7ba1826 100644
--- a/t/05-null-parser.t
+++ b/t/05-null-parser.t
@@ -16,7 +16,7 @@ plan 3;
}
});
-my $config = Config.new();
+my Config $config = Config.new();
ok $config.read("t/files/config", "Config::Parser::NULL"), "Attempt to read a file with Config::Parser::NULL";
diff --git a/t/06-deduce-parser.t b/t/06-deduce-parser.t
index 2811d19..5c39729 100644
--- a/t/06-deduce-parser.t
+++ b/t/06-deduce-parser.t
@@ -8,7 +8,7 @@ use Config;
plan 4;
-my $config = Config.new;
+my Config $config = Config.new();
subtest "Unknown parser type" => {
plan 1;