From 8389d7595813c990c685d9708ecfaf1fab973537 Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Wed, 28 Sep 2022 23:35:10 +0300 Subject: [PATCH] Add null value test --- source/mirage/config.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/mirage/config.d b/source/mirage/config.d index d20df5c..7cf4655 100644 --- a/source/mirage/config.d +++ b/source/mirage/config.d @@ -350,7 +350,7 @@ class ConfigDictionary { private string substituteEnvVars(ValueNode valueNode) { auto value = valueNode.value; if (value == null) { - return value; //todo test + return value; } auto result = ""; @@ -707,6 +707,12 @@ version (unittest) { assert(config.get("bla") == " blergh "); } + @("Null value stays null, not string") + unittest { + auto config = new ConfigDictionary(new ValueNode(null)); + assert(config.get(".") == null); + } + @("Read value from environment variable") unittest { environment["MIRAGE_CONFIG_TEST_ENV_VAR"] = "is set!";