summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-12 23:28:48 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-13 01:05:28 -0500
commita3aa7ee6ff7b3cc6e473367efd5fecf0f48f9635 (patch)
tree495e8f09b827a38c93dbf3c3478d725e1437643e
parent6fc00209d5906bd14d54af4a6ac2961dd9731f72 (diff)
tests: add test for continuation lines with comments
-rw-r--r--src/test/test-unit-file.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index 85191310d4..041daaba68 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -193,6 +193,11 @@ static void test_config_parse_exec(void) {
#define env_file_2 \
"a\\\n"
+#define env_file_3 \
+ "#SPAMD_ARGS=\"-d --socketpath=/var/lib/bulwark/spamd \\\n" \
+ "#--nouser-config \\\n" \
+ "normal=line"
+
static void test_load_env_file_1(void) {
char _cleanup_strv_free_ **data = NULL;
int r;
@@ -230,6 +235,21 @@ static void test_load_env_file_2(void) {
unlink(name);
}
+static void test_load_env_file_3(void) {
+ char _cleanup_strv_free_ **data = NULL;
+ int r;
+
+ char name[] = "/tmp/test-load-env-file.XXXXXX";
+ int _cleanup_close_ fd = mkstemp(name);
+ assert(fd >= 0);
+ assert_se(write(fd, env_file_3, sizeof(env_file_3)) == sizeof(env_file_3));
+
+ r = load_env_file(name, &data);
+ assert(r == 0);
+ assert(data == NULL);
+ unlink(name);
+}
+
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnonnull"
@@ -305,6 +325,7 @@ int main(int argc, char *argv[]) {
test_config_parse_exec();
test_load_env_file_1();
test_load_env_file_2();
+ test_load_env_file_3();
test_install_printf();
return 0;