Archived
1
0
Fork 0

common/path.c: ~ expand in normalize

This commit is contained in:
H Hautakoski 2010-09-18 21:05:23 +02:00 committed by Henrik Hautakoski
parent 8b0772d0f1
commit 4ca920dc01
2 changed files with 35 additions and 4 deletions

View file

@ -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);