File tree Expand file tree Collapse file tree 8 files changed +33
-4
lines changed
Expand file tree Collapse file tree 8 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ add_subdirectory(parsedate)
5252add_subdirectory (tool)
5353add_subdirectory (trn-artchk)
5454add_subdirectory (util)
55+ add_subdirectory (wildmat)
5556if (BUILD_TESTING)
5657 add_subdirectory (tests)
5758endif ()
Original file line number Diff line number Diff line change 1010#include < trn/string-algos.h>
1111#include < util/env.h>
1212#include < util/util2.h>
13- #include < util /wildmat.h>
13+ #include < wildmat /wildmat.h>
1414
1515#include < cstdio>
1616#include < cstdlib>
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ add_executable(trn-test
2222 test_rt-util.cpp
2323 test_string-algos.cpp
2424 test_utf.cpp
25+ test_wildmat.cpp
2526 ${CMAKE_CURRENT_BINARY_DIR} /test_config.h
2627 ${CMAKE_CURRENT_BINARY_DIR} /test_data.cpp
2728 ${CMAKE_CURRENT_BINARY_DIR} /test_mime.h
Original file line number Diff line number Diff line change 1+ #include < wildmat/wildmat.h>
2+
3+ #include < gtest/gtest.h>
4+
5+ TEST (TestWildMat, exactMatch)
6+ {
7+ EXPECT_TRUE (wildcard_match (" alt.flame" , " alt.flame" ));
8+ }
9+
10+ TEST (TestWildMat, fontMatch)
11+ {
12+ EXPECT_TRUE (
13+ wildcard_match (" -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1" , " -*-*-*-*-*-*-12-*-*-*-m-*-*-*" ));
14+ }
15+
16+ TEST (TestWildMat, fontMisMatch)
17+ {
18+ EXPECT_FALSE (
19+ wildcard_match (" -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1" , " -*-*-*-*-*-*-12-*-*-*-m-*-*-*" ));
20+ }
Original file line number Diff line number Diff line change 11add_library (util
22 env.cpp include /util/env.h include /util/env-internal .h
33 util2.cpp include /util/util2.h
4- wildmat.cpp include /util/wildmat.h
54)
65source_group ("CMake Scripts" REGULAR_EXPRESSION "^.*\\ .cmake$" )
76source_group ("Template Files" REGULAR_EXPRESSION "^.*\\ .in$" )
@@ -10,5 +9,5 @@ if(WIN32)
109endif ()
1110target_include_directories (util PUBLIC include )
1211target_include_directories (util PRIVATE ../libtrn/include ../tool/include )
13- target_link_libraries (util PUBLIC config)
12+ target_link_libraries (util PUBLIC config wildmat )
1413target_folder(util "Libraries" )
Original file line number Diff line number Diff line change 1+ add_library (wildmat
2+ wildmat.cpp include /wildmat/wildmat.h
3+ )
4+ if (WIN32 )
5+ target_compile_definitions (wildmat PUBLIC _CRT_DECLARE_NONSTDC_NAMES=1 _CRT_INTERNAL_NONSTDC_NAMES=1)
6+ endif ()
7+ target_include_directories (wildmat PUBLIC include )
8+ target_folder(wildmat "Libraries" )
File renamed without changes.
Original file line number Diff line number Diff line change 3636** on.
3737*/
3838
39- #include " util /wildmat.h"
39+ #include " wildmat /wildmat.h"
4040
4141 // What character marks an inverted character class?
4242#define NEGATE_CLASS ' ^'
You can’t perform that action at this time.
0 commit comments