diff options
Diffstat (limited to 't')
-rw-r--r-- | t/helper/test-reach.c | 2 | ||||
-rwxr-xr-x | t/t6600-test-reach.sh | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 14a3655442..cda804ed79 100644 --- a/t/helper/test-reach.c +++ b/t/helper/test-reach.c @@ -107,6 +107,8 @@ int cmd__reach(int ac, const char **av) printf("%s(A,B):%d\n", av[1], ref_newer(&oid_A, &oid_B)); else if (!strcmp(av[1], "in_merge_bases")) printf("%s(A,B):%d\n", av[1], in_merge_bases(A, B)); + else if (!strcmp(av[1], "in_merge_bases_many")) + printf("%s(A,X):%d\n", av[1], in_merge_bases_many(A, X_nr, X_array)); else if (!strcmp(av[1], "is_descendant_of")) printf("%s(A,X):%d\n", av[1], repo_is_descendant_of(r, A, X)); else if (!strcmp(av[1], "get_merge_bases_many")) { diff --git a/t/t6600-test-reach.sh b/t/t6600-test-reach.sh index 475564bee7..f807276337 100755 --- a/t/t6600-test-reach.sh +++ b/t/t6600-test-reach.sh @@ -110,6 +110,36 @@ test_expect_success 'in_merge_bases:miss' ' test_three_modes in_merge_bases ' +test_expect_success 'in_merge_bases_many:hit' ' + cat >input <<-\EOF && + A:commit-6-8 + X:commit-6-9 + X:commit-5-7 + EOF + echo "in_merge_bases_many(A,X):1" >expect && + test_three_modes in_merge_bases_many +' + +test_expect_success 'in_merge_bases_many:miss' ' + cat >input <<-\EOF && + A:commit-6-8 + X:commit-7-7 + X:commit-8-6 + EOF + echo "in_merge_bases_many(A,X):0" >expect && + test_three_modes in_merge_bases_many +' + +test_expect_success 'in_merge_bases_many:miss-heuristic' ' + cat >input <<-\EOF && + A:commit-6-8 + X:commit-7-5 + X:commit-6-6 + EOF + echo "in_merge_bases_many(A,X):0" >expect && + test_three_modes in_merge_bases_many +' + test_expect_success 'is_descendant_of:hit' ' cat >input <<-\EOF && A:commit-5-7 |