FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cli/tests/GitProgressParserTests.cpp at dev · vixcpp/cli · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
vixcpp
/
cli
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
10
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cli
/
tests
/
GitProgressParserTests.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 1022 Bytes
Breadcrumbs
cli
/
tests
/
GitProgressParserTests.cpp
Copy path
File metadata and controls
23 lines (20 loc) · 1022 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
include
<
vix/cli/util/GitProgress.hpp
>
#
include
<
cassert
>
#
include
<
vector
>
int
main
()
{
std::vector<vix::cli::util::GitProgressEvent> events;
vix::cli::util::GitProgressParser
parser
([&](
const
auto
&event) { events.
push_back
(event); });
parser.
push
(
"
Receiving obj
"
);
parser.
push
(
"
ects: 37% (123/331), 3.80 MiB | 1.40 MiB/s
\r
Resolving deltas: 81% (250/308)
\n
"
);
parser.
push
(
"
unknown Git message
\r
Receiving objects: 100% (331/331), 8.24 MiB | 2.10 MiB/s, done.
\r
"
);
parser.
push
(
"
Counting objects: malformed
\n
"
);
parser.
push
(
"
Counting objects: 999999999999999999999999% (1/2)
\n
"
);
parser.
finish
();
assert
(events.
size
() ==
3
);
assert
(events[
0
].
phase
==
"
receiving objects
"
&& events[
0
].
percent
==
37
);
assert
(events[
0
].
current
==
123
&& events[
0
].
total
==
331
);
assert
(events[
0
].
transferred
==
"
3.80 MiB
"
&& events[
0
].
speed
==
"
1.40 MiB/s
"
);
assert
(events[
1
].
phase
==
"
resolving deltas
"
&& events[
1
].
percent
==
81
);
assert
(events[
2
].
percent
==
100
&& events[
2
].
transferred
==
"
8.24 MiB
"
);
}
Back
|
FazBrowse Home
|
New Git URL