]> git.saurik.com Git - apt.git/blame - test/libapt/install_progress_test.cc
calculate only expected hashes in methods
[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
f00832cc 7#include <gtest/gtest.h>
fa211e2d 8
f00832cc
DK
9TEST(InstallProgressTest, FancyGetTextProgressStr)
10{
fa211e2d 11 APT::Progress::PackageManagerFancy p;
fa211e2d 12
f00832cc
DK
13 EXPECT_EQ(60, p.GetTextProgressStr(0.5, 60).size());
14 EXPECT_EQ("[#.]", p.GetTextProgressStr(0.5, 4));
15 EXPECT_EQ("[#.........]", p.GetTextProgressStr(0.1, 12));
16 EXPECT_EQ("[#########.]", p.GetTextProgressStr(0.9, 12));
fa211e2d
MV
17
18 // deal with incorrect inputs gracefully (or should we die instead?)
f00832cc 19 EXPECT_EQ("", p.GetTextProgressStr(-999, 12));
fa211e2d 20}