summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2018-10-17 22:41:20 +0200
committerDave Davenport <qball@gmpclient.org>2018-10-17 22:41:20 +0200
commitf80e7d52bcd10d1220be571e103e119bae4ad437 (patch)
tree8571bd3efc9ea09b99eac1b36759ed895ad4b08f /test
parente8edc42f9d078f7cde5b71e7780c0d6a1c99e96c (diff)
[Helper] Remove fixed key/values and accept keys with NULL as values.
Diffstat (limited to 'test')
-rw-r--r--test/helper-test.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/helper-test.c b/test/helper-test.c
index 052af651..5ed575e5 100644
--- a/test/helper-test.c
+++ b/test/helper-test.c
@@ -159,26 +159,30 @@ int main ( int argc, char ** argv )
char *a;
- a = helper_string_replace_if_exists ( "{terminal} [-t {title} blub ]-e {cmd}", "{cmd}", "aap", "{title}", "some title", NULL);
+ a = helper_string_replace_if_exists ( "{terminal} [-t {title} blub ]-e {cmd}", "{cmd}", "aap", "{title}", "some title", "{terminal}", "rofi-sensible-terminal", NULL);
printf("%s\n",a);
TASSERT ( g_utf8_collate ( a, "rofi-sensible-terminal -t some title blub -e aap") == 0);
g_free(a);
- a = helper_string_replace_if_exists ( "{terminal} [-t {title} blub ]-e {cmd}", "{cmd}", "aap", NULL);
+ a = helper_string_replace_if_exists ( "{terminal} [-t {title} blub ]-e {cmd}", "{cmd}", "aap", "{terminal}", "rofi-sensible-terminal", NULL);
printf("%s\n",a);
TASSERT ( g_utf8_collate ( a, "rofi-sensible-terminal -e aap") == 0);
g_free(a);
- a = helper_string_replace_if_exists ( "{name} [<span weight='light' size='small'><i>({category})</i></span>]", "{name}", "Librecad", "{category}", "Desktop app", NULL );
+ a = helper_string_replace_if_exists ( "{name} [<span weight='light' size='small'><i>({category})</i></span>]", "{name}", "Librecad", "{category}", "Desktop app", "{terminal}", "rofi-sensible-terminal", NULL );
printf("%s\n",a);
TASSERT ( g_utf8_collate ( a, "Librecad <span weight='light' size='small'><i>(Desktop app)</i></span>") == 0);
g_free(a);
- a = helper_string_replace_if_exists ( "{name}[ <span weight='light' size='small'><i>({category})</i></span>]", "{name}", "Librecad", NULL );
+ a = helper_string_replace_if_exists ( "{name}[ <span weight='light' size='small'><i>({category})</i></span>]", "{name}", "Librecad", "{terminal}", "rofi-sensible-terminal", NULL );
TASSERT ( g_utf8_collate ( a, "Librecad") == 0);
g_free(a);
- a = helper_string_replace_if_exists ( "{terminal} [{title} blub ]-e {cmd}", "{cmd}", "aap", "{title}", "some title", NULL);
+ a = helper_string_replace_if_exists ( "{terminal} [{title} blub ]-e {cmd}", "{cmd}", "aap", "{title}", "some title", "{terminal}", "rofi-sensible-terminal", NULL);
printf("%s\n",a);
TASSERT ( g_utf8_collate ( a, "rofi-sensible-terminal some title blub -e aap") == 0);
g_free(a);
- a = helper_string_replace_if_exists ( "{terminal} [{title} blub ]-e {cmd}", "{cmd}", "aap", "{title}", NULL, NULL);
+ a = helper_string_replace_if_exists ( "{terminal} [{title} blub ]-e {cmd}",
+ "{cmd}", "aap",
+ "{title}", NULL,
+ "{terminal}", "rofi-sensible-terminal",
+ NULL);
printf("%s\n",a);
TASSERT ( g_utf8_collate ( a, "rofi-sensible-terminal -e aap") == 0);
g_free(a);