tal/path: new module
[ccan] / ccan / tal / path / test / run-ext_off.c
1 #include <ccan/tal/path/path.h>
2 #include <ccan/tal/path/path.c>
3 #include <ccan/tap/tap.h>
4
5 int main(void)
6 {
7         plan_tests(9);
8
9         ok1(path_ext_off("foo") == 3);
10         ok1(path_ext_off(".foo") == 4);
11         ok1(path_ext_off("bar.foo") == 3);
12         ok1(path_ext_off("bar/foo") == 7);
13         ok1(path_ext_off("bar/.foo") == 8);
14         ok1(path_ext_off(".bar/foo") == 8);
15         ok1(path_ext_off("foo.bar/foo") == 11);
16         ok1(path_ext_off("foo.bar/foo.") == 11);
17         ok1(path_ext_off("foo.bar/foo..") == 12);
18         return exit_status();
19 }