]> git.saurik.com Git - apt.git/blame - test/libapt/install_progress_test.cc
Fix option name DPkg::Progress-Fancy in apt.8 manpage (LP: #1310506)
[apt.git] / test / libapt / install_progress_test.cc
CommitLineData
fa211e2d
MV
1#include <config.h>
2
3#include <apt-pkg/install-progress.h>
4
5#include <string>
6
7#include "assert.h"
8
9int 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}