From d7341373d4cecb7c8a3b78175ccc887fe73c8718 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 24 Mar 2023 08:56:02 +0300 Subject: [PATCH] fix empty key --- source/readconf.d | 2 +- tests/test.d | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/readconf.d b/source/readconf.d index ac6e942..42cdcf8 100644 --- a/source/readconf.d +++ b/source/readconf.d @@ -28,7 +28,7 @@ private: */ @property bool empty() { - return this.property.length = 0; + return this.property.length == 0; } /** diff --git a/tests/test.d b/tests/test.d index 9187e15..280c692 100644 --- a/tests/test.d +++ b/tests/test.d @@ -13,10 +13,8 @@ unittest assert(Config.file.key("value7") == "1234567890"); assert(Config.file.key("value8") == "12345.67890"); assert(Config.file.key("value9") == "You can use large margins"); - assert(!Config.file.key("value10").empty); - assert(Config.file.key("value10") == ""); - assert(!Config.file.key("value11").empty); - assert(Config.file.key("value11") == ""); + assert(Config.file.key("value10").empty); + assert(Config.file.key("value11").empty); assert(Config.file.key("value12") == "//path"); }