Skip to content

Commit 0489289

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-wildmatch into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 599fbd8 commit 0489289

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ TEST_BUILTINS_OBJS += test-string-list.o
685685
TEST_BUILTINS_OBJS += test-submodule-config.o
686686
TEST_BUILTINS_OBJS += test-subprocess.o
687687
TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
688+
TEST_BUILTINS_OBJS += test-wildmatch.o
688689

689690
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
690691
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -694,7 +695,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options
694695
TEST_PROGRAMS_NEED_X += test-write-cache
695696
TEST_PROGRAMS_NEED_X += test-svn-fe
696697
TEST_PROGRAMS_NEED_X += test-tool
697-
TEST_PROGRAMS_NEED_X += test-wildmatch
698698

699699
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
700700

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static struct test_cmd cmds[] = {
4040
{ "submodule-config", cmd__submodule_config },
4141
{ "subprocess", cmd__subprocess },
4242
{ "urlmatch-normalization", cmd__urlmatch_normalization },
43+
{ "wildmatch", cmd__wildmatch },
4344
};
4445

4546
int cmd_main(int argc, const char **argv)

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ int cmd__string_list(int argc, const char **argv);
3434
int cmd__submodule_config(int argc, const char **argv);
3535
int cmd__subprocess(int argc, const char **argv);
3636
int cmd__urlmatch_normalization(int argc, const char **argv);
37+
int cmd__wildmatch(int argc, const char **argv);
3738

3839
#endif

t/helper/test-wildmatch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#include "test-tool.h"
12
#include "cache.h"
23

3-
int cmd_main(int argc, const char **argv)
4+
int cmd__wildmatch(int argc, const char **argv)
45
{
56
int i;
67
for (i = 2; i < argc; i++) {

t/t3070-wildmatch.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ match_with_function() {
7979
if test "$match_expect" = 1
8080
then
8181
test_expect_success "$match_function: match '$text' '$pattern'" "
82-
test-wildmatch $match_function '$text' '$pattern'
82+
test-tool wildmatch $match_function '$text' '$pattern'
8383
"
8484
elif test "$match_expect" = 0
8585
then
8686
test_expect_success "$match_function: no match '$text' '$pattern'" "
87-
test_must_fail test-wildmatch $match_function '$text' '$pattern'
87+
test_must_fail test-tool wildmatch $match_function '$text' '$pattern'
8888
"
8989
else
9090
test_expect_success "PANIC: Test framework error. Unknown matches value $match_expect" 'false'
@@ -148,7 +148,7 @@ match_with_ls_files() {
148148
match() {
149149
if test "$#" = 6
150150
then
151-
# When test-wildmatch and git ls-files produce the same
151+
# When test-tool wildmatch and git ls-files produce the same
152152
# result.
153153
match_glob=$1
154154
match_file_glob=$match_glob
@@ -204,19 +204,19 @@ match() {
204204
fi
205205
'
206206

207-
# $1: Case sensitive glob match: test-wildmatch & ls-files
207+
# $1: Case sensitive glob match: test-tool wildmatch & ls-files
208208
match_with_function "$text" "$pattern" $match_glob "wildmatch"
209209
match_with_ls_files "$text" "$pattern" $match_file_glob "wildmatch" " --glob-pathspecs"
210210

211-
# $2: Case insensitive glob match: test-wildmatch & ls-files
211+
# $2: Case insensitive glob match: test-tool wildmatch & ls-files
212212
match_with_function "$text" "$pattern" $match_iglob "iwildmatch"
213213
match_with_ls_files "$text" "$pattern" $match_file_iglob "iwildmatch" " --glob-pathspecs --icase-pathspecs"
214214

215-
# $3: Case sensitive path match: test-wildmatch & ls-files
215+
# $3: Case sensitive path match: test-tool wildmatch & ls-files
216216
match_with_function "$text" "$pattern" $match_pathmatch "pathmatch"
217217
match_with_ls_files "$text" "$pattern" $match_file_pathmatch "pathmatch" ""
218218

219-
# $4: Case insensitive path match: test-wildmatch & ls-files
219+
# $4: Case insensitive path match: test-tool wildmatch & ls-files
220220
match_with_function "$text" "$pattern" $match_pathmatchi "ipathmatch"
221221
match_with_ls_files "$text" "$pattern" $match_file_pathmatchi "ipathmatch" " --icase-pathspecs"
222222
}

0 commit comments

Comments
 (0)