summaryrefslogtreecommitdiffstats
path: root/test/helper-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper-test.c')
-rw-r--r--test/helper-test.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/helper-test.c b/test/helper-test.c
index f5e2361d..91f5c143 100644
--- a/test/helper-test.c
+++ b/test/helper-test.c
@@ -49,17 +49,25 @@ int main ( int argc, char ** argv )
TASSERT ( strcmp ( list[4], "-c" ) == 0 );
TASSERT ( strcmp ( list[5], "ssh chuck; echo 'x-terminal-emulator chuck'" ) == 0 );
+ /**
+ * Test some path functions. Not easy as not sure what is right output on travis.
+ */
+ // Test if root is preserved.
char *str = rofi_expand_path("/");
TASSERT ( strcmp(str, "/") == 0 );
g_free(str);
+ // Test is relative path is preserved.
str = rofi_expand_path("../AUTHORS");
TASSERT ( strcmp(str, "../AUTHORS") == 0 );
g_free(str);
+ // Test another one.
str = rofi_expand_path("/bin/false");
TASSERT ( strcmp(str, "/bin/false") == 0 );
g_free(str);
+ // See if user paths get expanded in full path.
str = rofi_expand_path("~/");
- TASSERT ( str[0] == '/' );
+ const char *hd = g_get_home_dir();
+ TASSERT ( strcmp(str, hd) == 0);
g_free(str);
str = rofi_expand_path("~root/");
TASSERT ( str[0] == '/' );