]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/path/test/run-is_abs.c
tal/path: new module
[ccan] / ccan / tal / path / test / run-is_abs.c
diff --git a/ccan/tal/path/test/run-is_abs.c b/ccan/tal/path/test/run-is_abs.c
new file mode 100644 (file)
index 0000000..8cb0a1d
--- /dev/null
@@ -0,0 +1,16 @@
+#include <ccan/tal/path/path.h>
+#include <ccan/tal/path/path.c>
+#include <ccan/tap/tap.h>
+
+int main(void)
+{
+       plan_tests(5);
+
+       ok1(path_is_abs(PATH_SEP_STR "foo"));
+       ok1(!path_is_abs("foo"));
+       ok1(!path_is_abs("foo" PATH_SEP_STR));
+
+       ok1(path_is_abs(PATH_SEP_STR "foo" PATH_SEP_STR));
+       ok1(path_is_abs(PATH_SEP_STR "."));
+       return exit_status();
+}