]> git.saurik.com Git - apt.git/blob - test/libapt/install_progress_test.cc
force fancy progressbar redraw on window size change
[apt.git] / test / libapt / install_progress_test.cc
1 #include <config.h>
2
3 #include <apt-pkg/install-progress.h>
4
5 #include <string>
6
7 #include "assert.h"
8
9 int main() {
10 APT::Progress::PackageManagerFancy p;
11 std::string s;
12
13 s= p.GetTextProgressStr(0.5, 60);
14 equals(s.size(), 60);
15
16 s= p.GetTextProgressStr(0.5, 4);
17 equals(s, "[#.]");
18
19 s= p.GetTextProgressStr(0.1, 12);
20 equals(s, "[#.........]");
21
22 s= p.GetTextProgressStr(0.9, 12);
23 equals(s, "[#########.]");
24
25 // deal with incorrect inputs gracefully (or should we die instead?)
26 s= p.GetTextProgressStr(-999, 12);
27 equals(s, "");
28
29 return 0;
30 }