Compare commits

...

3 Commits

Author SHA1 Message Date
Alexander Zhirov d7341373d4 fix empty key 2023-03-24 08:56:02 +03:00
Alexander Zhirov 391ba8e797 value6 2023-03-24 08:41:06 +03:00
Alexander Zhirov e206abd027 fixed the expression in quotation marks 2023-03-24 08:35:43 +03:00
3 changed files with 6 additions and 9 deletions

View File

@ -33,7 +33,7 @@ value2 => Take the value in quotation marks
value3 => Or take in apostrophes
value4 => You can also comment
value5 => So you can also comment
value6 =>
value6 => "And you can even do that!"
value7 => 1234567890
value8 => 12345.67890
value9 => You can use large margins

View File

@ -28,7 +28,7 @@ private:
*/
@property bool empty()
{
return this.property.length = 0;
return this.property.length == 0;
}
/**
@ -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]);

View File

@ -9,15 +9,12 @@ 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");
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");
}