diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-02-01 17:57:58 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-02-01 17:57:58 +0100 |
commit | 5ca1c40c92f074315bbdfe328c00484ff18146f2 (patch) | |
tree | 3d801d2ec86d9b155326289bd4e557e8b956a61d /test | |
parent | f3fa39437c711f75949fbe0056007e343a428062 (diff) |
Fix configfile parsing of empty value lines and creation of missing configuration directory.
Diffstat (limited to 'test')
-rw-r--r-- | test/configtest.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/configtest.cc b/test/configtest.cc index a4d5228..85a59ca 100644 --- a/test/configtest.cc +++ b/test/configtest.cc @@ -69,6 +69,7 @@ public: DGUNIT_TEST(test_configtest::loading_error_no_value); DGUNIT_TEST(test_configtest::loading_error_string_not_terminated_single); DGUNIT_TEST(test_configtest::loading_error_string_not_terminated_double); + DGUNIT_TEST(test_configtest::empty_value); } void teardown() override @@ -213,6 +214,15 @@ public: TestConfigFile cf; DGUNIT_ASSERT_EQUAL(false, cf.load()); } + + void empty_value() + { + writeFile("a:\n"); + + TestConfigFile cf; + DGUNIT_ASSERT_EQUAL(true, cf.load()); + DGUNIT_ASSERT_EQUAL(std::string(""), cf.getValue("a")); + } }; // Registers the fixture into the 'registry' |