mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-23 03:10:01 +08:00
32 lines
668 B
C++
32 lines
668 B
C++
#include "ftxui/dom/elements.hpp"
|
|
#include "ftxui/screen/screen.hpp"
|
|
#include "gtest/gtest.h"
|
|
|
|
using namespace ftxui;
|
|
using namespace ftxui;
|
|
|
|
TEST(GaugeTest, zero) {
|
|
auto root = gauge(0);
|
|
Screen screen(11, 1);
|
|
Render(screen, root.get());
|
|
|
|
EXPECT_EQ(" ", screen.ToString());
|
|
}
|
|
|
|
TEST(GaugeTest, half) {
|
|
auto root = gauge(0.5);
|
|
Screen screen(11, 1);
|
|
Render(screen, root.get());
|
|
|
|
EXPECT_EQ("█████▍ ", screen.ToString());
|
|
//" ▏▎▍▌▊▉█";
|
|
}
|
|
|
|
TEST(GaugeTest, one) {
|
|
auto root = gauge(1.0);
|
|
Screen screen(11, 1);
|
|
Render(screen, root.get());
|
|
|
|
EXPECT_EQ("███████████", screen.ToString());
|
|
}
|