chiark / gitweb /
systemctl: don't show cgroup field for a unit if cgroup is empty
[elogind.git] / src / test / test-unit-file.c
index bb5cbdf9d7212852e7b129aebdeaf2e5733cd381..6636b949ea161795b8012987ae3e25a795ce35cc 100644 (file)
@@ -111,6 +111,29 @@ static void test_config_parse_exec(void) {
         check_execcommand(c1,
                           "/RValue/slashes3", "argv0a", "r1", true);
 
+        /* ignore && honour_argv0 */
+        r = config_parse_exec("fake", 4, "section",
+                              "LValue", 0, "@-/RValue///slashes4/// argv0b r1",
+                              &c, NULL);
+        assert_se(r >= 0);
+        c1 = c1->command_next;
+        check_execcommand(c1,
+                          "/RValue/slashes4", "argv0b", "r1", true);
+
+        /* ignore && ignore */
+        r = config_parse_exec("fake", 4, "section",
+                              "LValue", 0, "--/RValue argv0 r1",
+                              &c, NULL);
+        assert_se(r == 0);
+        assert_se(c1->command_next == NULL);
+
+        /* ignore && ignore */
+        r = config_parse_exec("fake", 4, "section",
+                              "LValue", 0, "-@-/RValue argv0 r1",
+                              &c, NULL);
+        assert_se(r == 0);
+        assert_se(c1->command_next == NULL);
+
         /* semicolon */
         r = config_parse_exec("fake", 5, "section",
                               "LValue", 0,
@@ -138,6 +161,16 @@ static void test_config_parse_exec(void) {
 
         assert_se(c1->command_next == NULL);
 
+        /* escaped semicolon */
+        r = config_parse_exec("fake", 5, "section",
+                              "LValue", 0,
+                              "/usr/bin/find \\;",
+                              &c, NULL);
+        assert_se(r >= 0);
+        c1 = c1->command_next;
+        check_execcommand(c1,
+                          "/usr/bin/find", "/usr/bin/find", ";", false);
+
         exec_command_free_list(c);
 }