chiark / gitweb /
test: extend unit-name test a bit
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Sep 2012 06:31:08 +0000 (08:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 12 Sep 2012 06:31:08 +0000 (08:31 +0200)
src/test/test-unit-name.c

index cf43455..50187e1 100644 (file)
@@ -53,6 +53,26 @@ int main(int argc, char* argv[]) {
         puts(t);
         free(t);
 
+        t = unit_name_replace_instance(".service", "waldo");
+        puts(t);
+        free(t);
+
+        t = unit_name_replace_instance("foo@bar", "waldo");
+        puts(t);
+        free(t);
+
+        t = unit_name_replace_instance("foo@", "waldo");
+        puts(t);
+        free(t);
+
+        t = unit_name_replace_instance("@", "waldo");
+        puts(t);
+        free(t);
+
+        t = unit_name_replace_instance("@bar", "waldo");
+        puts(t);
+        free(t);
+
         t = unit_name_from_path("/waldo", ".mount");
         puts(t);
         k = unit_name_to_path(t);