|
|
@ -85,6 +85,24 @@ TEST_CASE("TextLayout") {
|
|
|
|
ncplane_destroy(sp);
|
|
|
|
ncplane_destroy(sp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ensure we're honoring newlines
|
|
|
|
|
|
|
|
SUBCASE("LayoutNewlines") {
|
|
|
|
|
|
|
|
auto sp = ncplane_new(nc_, 5, 5, 0, 0, nullptr);
|
|
|
|
|
|
|
|
REQUIRE(sp);
|
|
|
|
|
|
|
|
const char boundstr[] = "a\nb\nc\nd\ne";
|
|
|
|
|
|
|
|
size_t bytes;
|
|
|
|
|
|
|
|
CHECK(0 < ncplane_puttext(sp, 0, NCALIGN_LEFT, boundstr, &bytes));
|
|
|
|
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
|
|
|
|
CHECK(bytes == strlen(boundstr));
|
|
|
|
|
|
|
|
char* line = ncplane_contents(sp, 0, 0, -1, -1);
|
|
|
|
|
|
|
|
REQUIRE(line);
|
|
|
|
|
|
|
|
fprintf(stderr, "LINE: [%s]\n", line);
|
|
|
|
|
|
|
|
sleep(5);
|
|
|
|
|
|
|
|
CHECK(0 == strcmp(line, "a b c d e"));
|
|
|
|
|
|
|
|
free(line);
|
|
|
|
|
|
|
|
ncplane_destroy(sp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// lay out text where a wide word crosses the boundary
|
|
|
|
// lay out text where a wide word crosses the boundary
|
|
|
|
SUBCASE("LayoutCrossBoundaryWide") {
|
|
|
|
SUBCASE("LayoutCrossBoundaryWide") {
|
|
|
|
if(enforce_utf8()){
|
|
|
|
if(enforce_utf8()){
|
|
|
|