mirror of
https://github.com/davatorium/rofi.git
synced 2025-04-07 17:33:14 -04:00
Fix func. def in wrong header file.
This commit is contained in:
parent
91e0f6b555
commit
e4c7fe8f1e
3 changed files with 17 additions and 10 deletions
|
@ -151,4 +151,12 @@ char helper_parse_char ( const char *arg );
|
|||
*/
|
||||
void cmd_set_arguments ( int argc, char **argv );
|
||||
|
||||
/**
|
||||
* @param input The path to expand
|
||||
*
|
||||
* Expand path, both `~` and `~<user>`
|
||||
*
|
||||
* @returns path
|
||||
*/
|
||||
char *rofi_expand_path ( const char *input );
|
||||
#endif // ROFI_HELPER_H
|
||||
|
|
|
@ -339,13 +339,4 @@ struct _Mode
|
|||
#define color_cyan_bold "\033[1;36m"
|
||||
|
||||
int show_error_message ( const char *msg, int markup );
|
||||
|
||||
/**
|
||||
* @param input The path to expand
|
||||
*
|
||||
* Expand path, both `~` and `~<user>`
|
||||
*
|
||||
* @returns path
|
||||
*/
|
||||
char *rofi_expand_path ( const char *input );
|
||||
#endif
|
||||
|
|
|
@ -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] == '/' );
|
||||
|
|
Loading…
Add table
Reference in a new issue