|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
#include <string> |
|
|
|
|
#include "ansi_parser.hpp" |
|
|
|
|
#include <codecvt> |
|
|
|
|
|
|
|
|
|
#include <iostream> |
|
|
|
|
|
|
|
|
|
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border |
|
|
|
|
#include "ftxui/dom/node.hpp" // for Render |
|
|
|
@ -53,10 +53,13 @@ std::string generate_colors() { |
|
|
|
|
|
|
|
|
|
TEST_CASE("test out ragel parser", "[gui]") { |
|
|
|
|
std::string colors = generate_colors(); |
|
|
|
|
std::cout << colors; |
|
|
|
|
sf::Color default_fg(0,0,0); |
|
|
|
|
sf::Color default_bg(100,100,100); |
|
|
|
|
ANSIParser parser(default_fg, default_bg); |
|
|
|
|
|
|
|
|
|
REQUIRE(ftxui::Terminal::ColorSupport() == Terminal::Color::TrueColor); |
|
|
|
|
|
|
|
|
|
bool good = parser.parse(colors, [&](sf::Color bgcolor, sf::Color color, wchar_t ch) { |
|
|
|
|
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r'; |
|
|
|
|
REQUIRE(correct_char); |
|
|
|
|