Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t/helper: merge test-wildmatch into test-tool
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 24 Mar 2018 07:45:04 +0000
(08:45 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 27 Mar 2018 15:45:47 +0000
(08:45 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
patch
|
blob
|
history
t/helper/test-tool.c
patch
|
blob
|
history
t/helper/test-tool.h
patch
|
blob
|
history
t/helper/test-wildmatch.c
patch
|
blob
|
history
t/t3070-wildmatch.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
599fbd8
)
diff --git
a/Makefile
b/Makefile
index 7923ec3747aef4982e468ca299eacd8604e4f328..2ab76c68383c8892a7bdc4f6a0668846a956c93b 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-685,6
+685,7
@@
TEST_BUILTINS_OBJS += test-string-list.o
TEST_BUILTINS_OBJS += test-submodule-config.o
TEST_BUILTINS_OBJS += test-subprocess.o
TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
TEST_BUILTINS_OBJS += test-submodule-config.o
TEST_BUILTINS_OBJS += test-subprocess.o
TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
+TEST_BUILTINS_OBJS += test-wildmatch.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@
-694,7
+695,6
@@
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-write-cache
TEST_PROGRAMS_NEED_X += test-svn-fe
TEST_PROGRAMS_NEED_X += test-tool
TEST_PROGRAMS_NEED_X += test-write-cache
TEST_PROGRAMS_NEED_X += test-svn-fe
TEST_PROGRAMS_NEED_X += test-tool
-TEST_PROGRAMS_NEED_X += test-wildmatch
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
diff --git
a/t/helper/test-tool.c
b/t/helper/test-tool.c
index e84e2ab253d02092901d9054b4d5ffa323eeaef3..068adf47d684439230096e736c42c5cbb96d7902 100644
(file)
--- a/
t/helper/test-tool.c
+++ b/
t/helper/test-tool.c
@@
-40,6
+40,7
@@
static struct test_cmd cmds[] = {
{ "submodule-config", cmd__submodule_config },
{ "subprocess", cmd__subprocess },
{ "urlmatch-normalization", cmd__urlmatch_normalization },
{ "submodule-config", cmd__submodule_config },
{ "subprocess", cmd__subprocess },
{ "urlmatch-normalization", cmd__urlmatch_normalization },
+ { "wildmatch", cmd__wildmatch },
};
int cmd_main(int argc, const char **argv)
};
int cmd_main(int argc, const char **argv)
diff --git
a/t/helper/test-tool.h
b/t/helper/test-tool.h
index fa53c8265901e6605aad3ba280b2a9fb9480f422..84c583e68f6ae0309ff52ba943068d8396b54f5c 100644
(file)
--- a/
t/helper/test-tool.h
+++ b/
t/helper/test-tool.h
@@
-34,5
+34,6
@@
int cmd__string_list(int argc, const char **argv);
int cmd__submodule_config(int argc, const char **argv);
int cmd__subprocess(int argc, const char **argv);
int cmd__urlmatch_normalization(int argc, const char **argv);
int cmd__submodule_config(int argc, const char **argv);
int cmd__subprocess(int argc, const char **argv);
int cmd__urlmatch_normalization(int argc, const char **argv);
+int cmd__wildmatch(int argc, const char **argv);
#endif
#endif
diff --git
a/t/helper/test-wildmatch.c
b/t/helper/test-wildmatch.c
index 66d33dfcfd1a0b3fa6b94a029aab9117a2511224..2c103d1824cfc7f035aea4a6453c9706f9b4491e 100644
(file)
--- a/
t/helper/test-wildmatch.c
+++ b/
t/helper/test-wildmatch.c
@@
-1,6
+1,7
@@
+#include "test-tool.h"
#include "cache.h"
#include "cache.h"
-int cmd_
main
(int argc, const char **argv)
+int cmd_
_wildmatch
(int argc, const char **argv)
{
int i;
for (i = 2; i < argc; i++) {
{
int i;
for (i = 2; i < argc; i++) {
diff --git
a/t/t3070-wildmatch.sh
b/t/t3070-wildmatch.sh
index c1fc6ca7301eaa9b15ef091ce592989956efc156..dce102130fb77ddda7cdc9aa9211507d9c2f2e09 100755
(executable)
--- a/
t/t3070-wildmatch.sh
+++ b/
t/t3070-wildmatch.sh
@@
-79,12
+79,12
@@
match_with_function() {
if test "$match_expect" = 1
then
test_expect_success "$match_function: match '$text' '$pattern'" "
if test "$match_expect" = 1
then
test_expect_success "$match_function: match '$text' '$pattern'" "
- test-wildmatch $match_function '$text' '$pattern'
+ test-
tool
wildmatch $match_function '$text' '$pattern'
"
elif test "$match_expect" = 0
then
test_expect_success "$match_function: no match '$text' '$pattern'" "
"
elif test "$match_expect" = 0
then
test_expect_success "$match_function: no match '$text' '$pattern'" "
- test_must_fail test-wildmatch $match_function '$text' '$pattern'
+ test_must_fail test-
tool
wildmatch $match_function '$text' '$pattern'
"
else
test_expect_success "PANIC: Test framework error. Unknown matches value $match_expect" 'false'
"
else
test_expect_success "PANIC: Test framework error. Unknown matches value $match_expect" 'false'
@@
-148,7
+148,7
@@
match_with_ls_files() {
match() {
if test "$#" = 6
then
match() {
if test "$#" = 6
then
- # When test-wildmatch and git ls-files produce the same
+ # When test-
tool
wildmatch and git ls-files produce the same
# result.
match_glob=$1
match_file_glob=$match_glob
# result.
match_glob=$1
match_file_glob=$match_glob
@@
-204,19
+204,19
@@
match() {
fi
'
fi
'
- # $1: Case sensitive glob match: test-wildmatch & ls-files
+ # $1: Case sensitive glob match: test-
tool
wildmatch & ls-files
match_with_function "$text" "$pattern" $match_glob "wildmatch"
match_with_ls_files "$text" "$pattern" $match_file_glob "wildmatch" " --glob-pathspecs"
match_with_function "$text" "$pattern" $match_glob "wildmatch"
match_with_ls_files "$text" "$pattern" $match_file_glob "wildmatch" " --glob-pathspecs"
- # $2: Case insensitive glob match: test-wildmatch & ls-files
+ # $2: Case insensitive glob match: test-
tool
wildmatch & ls-files
match_with_function "$text" "$pattern" $match_iglob "iwildmatch"
match_with_ls_files "$text" "$pattern" $match_file_iglob "iwildmatch" " --glob-pathspecs --icase-pathspecs"
match_with_function "$text" "$pattern" $match_iglob "iwildmatch"
match_with_ls_files "$text" "$pattern" $match_file_iglob "iwildmatch" " --glob-pathspecs --icase-pathspecs"
- # $3: Case sensitive path match: test-wildmatch & ls-files
+ # $3: Case sensitive path match: test-
tool
wildmatch & ls-files
match_with_function "$text" "$pattern" $match_pathmatch "pathmatch"
match_with_ls_files "$text" "$pattern" $match_file_pathmatch "pathmatch" ""
match_with_function "$text" "$pattern" $match_pathmatch "pathmatch"
match_with_ls_files "$text" "$pattern" $match_file_pathmatch "pathmatch" ""
- # $4: Case insensitive path match: test-wildmatch & ls-files
+ # $4: Case insensitive path match: test-
tool
wildmatch & ls-files
match_with_function "$text" "$pattern" $match_pathmatchi "ipathmatch"
match_with_ls_files "$text" "$pattern" $match_file_pathmatchi "ipathmatch" " --icase-pathspecs"
}
match_with_function "$text" "$pattern" $match_pathmatchi "ipathmatch"
match_with_ls_files "$text" "$pattern" $match_file_pathmatchi "ipathmatch" " --icase-pathspecs"
}