Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t/helper: merge test-sha1-array into test-tool
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 24 Mar 2018 07:44:57 +0000
(08:44 +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-sha1-array.c
patch
|
blob
|
history
t/helper/test-tool.c
patch
|
blob
|
history
t/helper/test-tool.h
patch
|
blob
|
history
t/t0064-sha1-array.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
ff5fb8b
)
diff --git
a/Makefile
b/Makefile
index ba7c7d8a79f4454c5ad2934421da8bfa7bcb2ce2..b50a0818a96ab097caac049fd915e4d048fdeb18 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-677,6
+677,7
@@
TEST_BUILTINS_OBJS += test-regex.o
TEST_BUILTINS_OBJS += test-revision-walking.o
TEST_BUILTINS_OBJS += test-run-command.o
TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
TEST_BUILTINS_OBJS += test-revision-walking.o
TEST_BUILTINS_OBJS += test-run-command.o
TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
+TEST_BUILTINS_OBJS += test-sha1-array.o
TEST_BUILTINS_OBJS += test-sha1.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_BUILTINS_OBJS += test-sha1.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@
-685,7
+686,6
@@
TEST_PROGRAMS_NEED_X += test-fake-ssh
TEST_PROGRAMS_NEED_X += test-line-buffer
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-write-cache
TEST_PROGRAMS_NEED_X += test-line-buffer
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-write-cache
-TEST_PROGRAMS_NEED_X += test-sha1-array
TEST_PROGRAMS_NEED_X += test-sigchain
TEST_PROGRAMS_NEED_X += test-strcmp-offset
TEST_PROGRAMS_NEED_X += test-string-list
TEST_PROGRAMS_NEED_X += test-sigchain
TEST_PROGRAMS_NEED_X += test-strcmp-offset
TEST_PROGRAMS_NEED_X += test-string-list
diff --git
a/t/helper/test-sha1-array.c
b/t/helper/test-sha1-array.c
index edfd52d82aeca0bb9ba2c5b2ce18bc39d27e5a34..ad5e69f9d3b0e03442f0d23b3b559bbfc163ee7b 100644
(file)
--- a/
t/helper/test-sha1-array.c
+++ b/
t/helper/test-sha1-array.c
@@
-1,3
+1,4
@@
+#include "test-tool.h"
#include "cache.h"
#include "sha1-array.h"
#include "cache.h"
#include "sha1-array.h"
@@
-7,7
+8,7
@@
static int print_oid(const struct object_id *oid, void *data)
return 0;
}
return 0;
}
-int cmd_
main
(int argc, const char **argv)
+int cmd_
_sha1_array
(int argc, const char **argv)
{
struct oid_array array = OID_ARRAY_INIT;
struct strbuf line = STRBUF_INIT;
{
struct oid_array array = OID_ARRAY_INIT;
struct strbuf line = STRBUF_INIT;
diff --git
a/t/helper/test-tool.c
b/t/helper/test-tool.c
index f0284cc7cf5fb25cd173c9c888b35d4f18b8a32d..691bdcbb3210292e245197fefe7e1e763e93772d 100644
(file)
--- a/
t/helper/test-tool.c
+++ b/
t/helper/test-tool.c
@@
-32,6
+32,7
@@
static struct test_cmd cmds[] = {
{ "revision-walking", cmd__revision_walking },
{ "run-command", cmd__run_command },
{ "scrap-cache-tree", cmd__scrap_cache_tree },
{ "revision-walking", cmd__revision_walking },
{ "run-command", cmd__run_command },
{ "scrap-cache-tree", cmd__scrap_cache_tree },
+ { "sha1-array", cmd__sha1_array },
{ "sha1", cmd__sha1 },
};
{ "sha1", cmd__sha1 },
};
diff --git
a/t/helper/test-tool.h
b/t/helper/test-tool.h
index 448119a44a17d80d27ab25eb0e2b2749589425ca..d8066e3f63fa6a14397f469df42ba303ee9e7eeb 100644
(file)
--- a/
t/helper/test-tool.h
+++ b/
t/helper/test-tool.h
@@
-26,6
+26,7
@@
int cmd__regex(int argc, const char **argv);
int cmd__revision_walking(int argc, const char **argv);
int cmd__run_command(int argc, const char **argv);
int cmd__scrap_cache_tree(int argc, const char **argv);
int cmd__revision_walking(int argc, const char **argv);
int cmd__run_command(int argc, const char **argv);
int cmd__scrap_cache_tree(int argc, const char **argv);
+int cmd__sha1_array(int argc, const char **argv);
int cmd__sha1(int argc, const char **argv);
#endif
int cmd__sha1(int argc, const char **argv);
#endif
diff --git
a/t/t0064-sha1-array.sh
b/t/t0064-sha1-array.sh
index 50b31ffe756658dfa8ce435381ad7f48fee91462..67484502a007e3fed09fe381898bee52d21d07bb 100755
(executable)
--- a/
t/t0064-sha1-array.sh
+++ b/
t/t0064-sha1-array.sh
@@
-18,7
+18,7
@@
test_expect_success 'ordered enumeration' '
{
echo20 append 88 44 aa 55 &&
echo for_each_unique
{
echo20 append 88 44 aa 55 &&
echo for_each_unique
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
test_cmp expect actual
'
test_cmp expect actual
'
@@
-28,7
+28,7
@@
test_expect_success 'ordered enumeration with duplicate suppression' '
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo for_each_unique
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo for_each_unique
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
test_cmp expect actual
'
test_cmp expect actual
'
@@
-36,7
+36,7
@@
test_expect_success 'lookup' '
{
echo20 append 88 44 aa 55 &&
echo20 lookup 55
{
echo20 append 88 44 aa 55 &&
echo20 lookup 55
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -eq 1
'
n=$(cat actual) &&
test "$n" -eq 1
'
@@
-45,7
+45,7
@@
test_expect_success 'lookup non-existing entry' '
{
echo20 append 88 44 aa 55 &&
echo20 lookup 33
{
echo20 append 88 44 aa 55 &&
echo20 lookup 33
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -lt 0
'
n=$(cat actual) &&
test "$n" -lt 0
'
@@
-55,7
+55,7
@@
test_expect_success 'lookup with duplicates' '
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo20 lookup 55
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo20 lookup 55
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -ge 2 &&
test "$n" -le 3
n=$(cat actual) &&
test "$n" -ge 2 &&
test "$n" -le 3
@@
-66,7
+66,7
@@
test_expect_success 'lookup non-existing entry with duplicates' '
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo20 lookup 66
echo20 append 88 44 aa 55 &&
echo20 append 88 44 aa 55 &&
echo20 lookup 66
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -lt 0
'
n=$(cat actual) &&
test "$n" -lt 0
'
@@
-76,7
+76,7
@@
test_expect_success 'lookup with almost duplicate values' '
echo "append 5555555555555555555555555555555555555555" &&
echo "append 555555555555555555555555555555555555555f" &&
echo20 lookup 55
echo "append 5555555555555555555555555555555555555555" &&
echo "append 555555555555555555555555555555555555555f" &&
echo20 lookup 55
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -eq 0
'
n=$(cat actual) &&
test "$n" -eq 0
'
@@
-85,7
+85,7
@@
test_expect_success 'lookup with single duplicate value' '
{
echo20 append 55 55 &&
echo20 lookup 55
{
echo20 append 55 55 &&
echo20 lookup 55
- } | test-sha1-array >actual &&
+ } | test-
tool
sha1-array >actual &&
n=$(cat actual) &&
test "$n" -ge 0 &&
test "$n" -le 1
n=$(cat actual) &&
test "$n" -ge 0 &&
test "$n" -le 1