Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
0a25141e
Unverified
Commit
0a25141e
authored
Feb 21, 2019
by
Augustin Fabre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branch: add test for git_branch_lookup to accept GIT_BRANCH_ALL
parent
12c6e1fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
tests/refs/branches/lookup.c
+25
-2
No files found.
tests/refs/branches/lookup.c
View file @
0a25141e
...
...
@@ -20,20 +20,41 @@ void test_refs_branches_lookup__cleanup(void)
repo
=
NULL
;
}
void
test_refs_branches_lookup__can_retrieve_a_local_branch
(
void
)
void
test_refs_branches_lookup__can_retrieve_a_local_branch
_local
(
void
)
{
cl_git_pass
(
git_branch_lookup
(
&
branch
,
repo
,
"br2"
,
GIT_BRANCH_LOCAL
));
}
void
test_refs_branches_lookup__can_retrieve_a_remote_tracking_branch
(
void
)
void
test_refs_branches_lookup__can_retrieve_a_local_branch_all
(
void
)
{
cl_git_pass
(
git_branch_lookup
(
&
branch
,
repo
,
"br2"
,
GIT_BRANCH_ALL
));
}
void
test_refs_branches_lookup__trying_to_retrieve_a_local_branch_remote
(
void
)
{
cl_git_fail
(
git_branch_lookup
(
&
branch
,
repo
,
"br2"
,
GIT_BRANCH_REMOTE
));
}
void
test_refs_branches_lookup__can_retrieve_a_remote_tracking_branch_remote
(
void
)
{
cl_git_pass
(
git_branch_lookup
(
&
branch
,
repo
,
"test/master"
,
GIT_BRANCH_REMOTE
));
}
void
test_refs_branches_lookup__can_retrieve_a_remote_tracking_branch_all
(
void
)
{
cl_git_pass
(
git_branch_lookup
(
&
branch
,
repo
,
"test/master"
,
GIT_BRANCH_ALL
));
}
void
test_refs_branches_lookup__trying_to_retrieve_a_remote_tracking_branch_local
(
void
)
{
cl_git_fail
(
git_branch_lookup
(
&
branch
,
repo
,
"test/master"
,
GIT_BRANCH_LOCAL
));
}
void
test_refs_branches_lookup__trying_to_retrieve_an_unknown_branch_returns_ENOTFOUND
(
void
)
{
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_branch_lookup
(
&
branch
,
repo
,
"where/are/you"
,
GIT_BRANCH_LOCAL
));
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_branch_lookup
(
&
branch
,
repo
,
"over/here"
,
GIT_BRANCH_REMOTE
));
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_branch_lookup
(
&
branch
,
repo
,
"maybe/here"
,
GIT_BRANCH_ALL
));
}
void
test_refs_branches_lookup__trying_to_retrieve_a_branch_with_an_invalid_name_returns_EINVALIDSPEC
(
void
)
...
...
@@ -42,4 +63,6 @@ void test_refs_branches_lookup__trying_to_retrieve_a_branch_with_an_invalid_name
git_branch_lookup
(
&
branch
,
repo
,
"are/you/inv@{id"
,
GIT_BRANCH_LOCAL
));
cl_assert_equal_i
(
GIT_EINVALIDSPEC
,
git_branch_lookup
(
&
branch
,
repo
,
"yes/i am"
,
GIT_BRANCH_REMOTE
));
cl_assert_equal_i
(
GIT_EINVALIDSPEC
,
git_branch_lookup
(
&
branch
,
repo
,
"inv al/id"
,
GIT_BRANCH_ALL
));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment