path: added mkpath
This commit is contained in:
parent
9c73f8f867
commit
1b3035b249
4 changed files with 41 additions and 1 deletions
|
|
@ -36,6 +36,12 @@ void test_normalize() {
|
|||
free(ptr);
|
||||
}
|
||||
|
||||
void test_mkpath() {
|
||||
|
||||
assert_string(mkpath("%s/%s", "/mnt/", "file"), "/mnt//file");
|
||||
assert_string(mkpath("%s/%s%i", "/dev", "tty", 2), "/dev/tty2");
|
||||
}
|
||||
|
||||
void test_isabspath() {
|
||||
|
||||
assert(is_abspath("file") == 0);
|
||||
|
|
@ -115,6 +121,7 @@ int main(int argc, char *argv[]) {
|
|||
test_isfile();
|
||||
test_isdir();
|
||||
test_normalize();
|
||||
test_mkpath();
|
||||
test_basename();
|
||||
test_dirname();
|
||||
|
||||
|
|
|
|||
Reference in a new issue