1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * @file test_filename.c Test file name operations
4 * @author David Huggins-Daines <dhuggins@cs.cmu.edu>
8 #include "test_macros.h"
15 main(int argc, char *argv[])
17 char const testname[] = "/foo/bar/baz/quux.argh";
18 char const testname2[] = "foo/bar/baz";
19 char const testname3[] = "/foo";
22 path2basename(testname, testout);
23 TEST_EQUAL(0, strcmp("quux.argh", testout));
25 path2dirname(testname, testout);
26 TEST_EQUAL(0, strcmp("/foo/bar/baz", testout));
28 path2dirname(testname2, testout);
29 TEST_EQUAL(0, strcmp("foo/bar", testout));
31 path2dirname(testname3, testout);
32 TEST_EQUAL(0, strcmp("", testout));