|
13 | 13 | */ |
14 | 14 | ZTEST(posix_c_lib_ext, test_fnmatch) |
15 | 15 | { |
16 | | - /* Note: commented out lines indicate known problems to be addressed in #55186 */ |
17 | | - |
18 | 16 | zassert_ok(fnmatch("*.c", "foo.c", 0)); |
19 | 17 | zassert_ok(fnmatch("*.c", ".c", 0)); |
20 | 18 | zassert_equal(fnmatch("*.a", "foo.c", 0), FNM_NOMATCH); |
@@ -73,11 +71,20 @@ ZTEST(posix_c_lib_ext, test_fnmatch) |
73 | 71 | zassert_equal(fnmatch("*/*", "a/.b", FNM_PATHNAME | FNM_PERIOD), FNM_NOMATCH); |
74 | 72 | zassert_ok(fnmatch("*?*/*", "a/.b", FNM_PERIOD)); |
75 | 73 | zassert_ok(fnmatch("*[.]/b", "a./b", FNM_PATHNAME | FNM_PERIOD)); |
76 | | - /** Test cases for POSIC classes */ |
| 74 | + /** Test cases for POSIX classes */ |
| 75 | + zassert_ok(fnmatch("*[[:alpha:]]", "Z", 0)); |
| 76 | + zassert_ok(fnmatch("*[[:digit:]]", "7", 0)); |
| 77 | + zassert_ok(fnmatch("*[[:alnum:]]", "X9", 0)); |
| 78 | + zassert_ok(fnmatch("*[[:lower:]]", "z", 0)); |
| 79 | + zassert_ok(fnmatch("*[[:upper:]]", "G", 0)); |
| 80 | + zassert_ok(fnmatch("*[[:space:]]", " ", 0)); |
77 | 81 | zassert_ok(fnmatch("*[[:alpha:]]/""*[[:alnum:]]", "a/b", FNM_PATHNAME)); |
78 | 82 | zassert_not_equal(fnmatch("*[![:digit:]]*/[![:d-d]", "a/b", FNM_PATHNAME), 0); |
79 | 83 | zassert_not_equal(fnmatch("*[![:digit:]]*/[[:d-d]", "a/[", FNM_PATHNAME), 0); |
80 | 84 | zassert_not_equal(fnmatch("*[![:digit:]]*/[![:d-d]", "a/[", FNM_PATHNAME), 0); |
| 85 | + zassert_ok(fnmatch("file[0-9].txt", "file3.txt", 0)); |
| 86 | + zassert_ok(fnmatch("dir/*", "dir/file", FNM_PATHNAME)); |
| 87 | + zassert_equal(fnmatch("dir/*", "dir/sub/file", FNM_PATHNAME), FNM_NOMATCH); |
81 | 88 | zassert_ok(fnmatch("a?b", "a.b", FNM_PATHNAME | FNM_PERIOD)); |
82 | 89 | zassert_ok(fnmatch("a*b", "a.b", FNM_PATHNAME | FNM_PERIOD)); |
83 | 90 | zassert_ok(fnmatch("a[.]b", "a.b", FNM_PATHNAME | FNM_PERIOD)); |
|
0 commit comments