Add glob test: ‘*.ext’ doesn’t match ‘.ext’

I wasn’t sure if this was really desired, but it mimics bash.
This commit is contained in:
Allan Odgaard
2012-09-16 10:36:42 +02:00
parent 363ba94fb8
commit ec4ac60ae4

View File

@@ -60,6 +60,13 @@ public:
TS_ASSERT( path::glob_t("{,.}*").does_match("test"));
TS_ASSERT( path::glob_t("{,.}*").does_match(".htaccess"));
TS_ASSERT( path::glob_t("*file").does_match("file"));
TS_ASSERT( path::glob_t("fi*le").does_match("file"));
TS_ASSERT( path::glob_t("file*").does_match("file"));
TS_ASSERT(!path::glob_t("*.ext").does_match(".ext"));
TS_ASSERT( path::glob_t(".*ext").does_match(".ext"));
TS_ASSERT( path::glob_t(".ext*").does_match(".ext"));
TS_ASSERT( path::glob_t("*" ).does_match("foo.txt"));
TS_ASSERT( path::glob_t("foo*" ).does_match("foo.txt"));
TS_ASSERT( path::glob_t("foo/*" ).does_match("foo/bar.txt"));