mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
LayoutNewlines unit test #829
This commit is contained in:
parent
679e2d25f8
commit
adab5ba382
@ -85,6 +85,24 @@ TEST_CASE("TextLayout") {
|
||||
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
|
||||
SUBCASE("LayoutCrossBoundaryWide") {
|
||||
if(enforce_utf8()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user