#include #include #include "render.hpp" #include "panel.hpp" using namespace ftxui; using namespace fmt; using std::string; void run_renderer(SFMLRender &renderer, Panel &panel) { panel.render(); renderer.display(); REQUIRE(renderer.is_open() == true); renderer.clear(); renderer.draw(panel); } TEST_CASE("can render a text or grid panel", "[render]") { SFMLRender renderer; Panel panel(0, 0, 20, 5); Panel grid(200, 200, 20, 5, true); auto text_box = Renderer([]{ return hbox({ hflow( vbox(text("I AM TEXT")) )}); }); panel.set_renderer(text_box); grid.set_renderer(text_box); run_renderer(renderer, panel); run_renderer(renderer, grid); renderer.close(); }