]>
git.saurik.com Git - apt.git/blob - test/libapt/install_progress_test.cc
3 #include <apt-pkg/install-progress.h>
7 #include <gtest/gtest.h>
9 TEST(InstallProgressTest
, FancyGetTextProgressStr
)
11 APT::Progress::PackageManagerFancy p
;
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));
18 // deal with incorrect inputs gracefully (or should we die instead?)
19 EXPECT_EQ("", p
.GetTextProgressStr(-999, 12));