From ec4ac60ae4f276d723b7541acca2d7a61bf86b2e Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sun, 16 Sep 2012 10:36:42 +0200 Subject: [PATCH] =?UTF-8?q?Add=20glob=20test:=20=E2=80=98*.ext=E2=80=99=20?= =?UTF-8?q?doesn=E2=80=99t=20match=20=E2=80=98.ext=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I wasn’t sure if this was really desired, but it mimics bash. --- Frameworks/regexp/tests/t_glob.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Frameworks/regexp/tests/t_glob.cc b/Frameworks/regexp/tests/t_glob.cc index 63faa8e3..3a73ed2e 100644 --- a/Frameworks/regexp/tests/t_glob.cc +++ b/Frameworks/regexp/tests/t_glob.cc @@ -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"));