From e206abd027e78068a94dc7eea157f2f6f26de4aa Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 24 Mar 2023 08:35:43 +0300 Subject: [PATCH] fixed the expression in quotation marks --- source/readconf.d | 2 +- tests/test.d | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/readconf.d b/source/readconf.d index c9aa760..ac6e942 100644 --- a/source/readconf.d +++ b/source/readconf.d @@ -84,7 +84,7 @@ private: { if (match[group][0] == '\'') group = 10; - if (match[group][0] == '\"') + else if (match[group][0] == '\"') group = 8; } this.properties[match[1]] = PP(match[1], match[group]); diff --git a/tests/test.d b/tests/test.d index bfb5424..9187e15 100644 --- a/tests/test.d +++ b/tests/test.d @@ -9,8 +9,7 @@ unittest assert(Config.file.key("value3") == "Or take in apostrophes"); assert(Config.file.key("value4") == "You can also comment"); assert(Config.file.key("value5") == "So you can also comment"); - // assert(Config.file.key("value6") == "\"And you can even do that!\""); - assert(Config.file.key("value6") == ""); // D unable to read quotes + assert(Config.file.key("value6") == "\"And you can even do that!\""); assert(Config.file.key("value7") == "1234567890"); assert(Config.file.key("value8") == "12345.67890"); assert(Config.file.key("value9") == "You can use large margins");