common/path.c: ~ expand in normalize
This commit is contained in:
parent
8b0772d0f1
commit
4ca920dc01
2 changed files with 35 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "unit.h"
|
||||
#include "../src/common/path.h"
|
||||
|
||||
|
|
@ -23,6 +24,14 @@ void test_normalize() {
|
|||
assert_string(ptr, "/stuff/with/ahell/lot/of/slashes/at/the/end/");
|
||||
free(ptr);
|
||||
|
||||
ptr = path_normalize("~", NULL, 0);
|
||||
printf("HOME EXPAND: %s\n", ptr);
|
||||
free(ptr);
|
||||
|
||||
ptr = path_normalize("~/sub", "file", 0);
|
||||
printf("HOME EXPAND2: %s\n", ptr);
|
||||
free(ptr);
|
||||
|
||||
ptr = path_normalize("/mnt/cdrom", "keff", 0);
|
||||
assert_string(ptr, "/mnt/cdrom/keff");
|
||||
free(ptr);
|
||||
|
|
|
|||
Reference in a new issue