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
f6f7537c
Commit
f6f7537c
authored
Nov 12, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some failing blame test cases
parent
42593a69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
tests-clar/blame/buffer.c
+36
-0
No files found.
tests-clar/blame/buffer.c
View file @
f6f7537c
...
...
@@ -19,6 +19,8 @@ void test_blame_buffer__cleanup(void)
void
test_blame_buffer__added_line
(
void
)
{
git_blame_hunk
*
hunk
;
const
char
*
buffer
=
"\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
...
...
@@ -39,6 +41,10 @@ CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
cl_git_pass
(
git_blame_buffer
(
&
g_bufferblame
,
g_fileblame
,
buffer
,
strlen
(
buffer
)));
cl_assert_equal_i
(
5
,
git_blame_get_hunk_count
(
g_bufferblame
));
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
2
,
6
,
1
,
0
,
"000000"
,
"b.txt"
);
hunk
=
git_blame_get_hunk_byline
(
g_bufferblame
,
16
);
cl_assert
(
hunk
);
cl_assert_equal_s
(
"Ben Straub"
,
hunk
->
final_signature
->
name
);
}
void
test_blame_buffer__deleted_line
(
void
)
...
...
@@ -128,3 +134,33 @@ CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
3
,
7
,
1
,
0
,
"00000000"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
4
,
8
,
3
,
0
,
"63d671eb"
,
"b.txt"
);
}
void
test_blame_buffer__add_line_at_end
(
void
)
{
const
char
*
buffer
=
"\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
\n
\
\n
\
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
\n
\
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
\n
\
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
\n
\
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
\n
\
\n
\
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
\n
\
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
\n
\
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
\n
\
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
\n
\
abc
\n
\
\n
"
;
cl_git_pass
(
git_blame_buffer
(
&
g_bufferblame
,
g_fileblame
,
buffer
,
strlen
(
buffer
)));
cl_assert_equal_i
(
5
,
git_blame_get_hunk_count
(
g_bufferblame
));
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
0
,
1
,
4
,
0
,
"da237394"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
1
,
5
,
1
,
1
,
"b99f7ac0"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
2
,
6
,
5
,
0
,
"63d671eb"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
3
,
11
,
5
,
0
,
"aa06ecca"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_bufferblame
,
4
,
16
,
1
,
0
,
"00000000"
,
"b.txt"
);
}
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