add unit test for putchar on tab #1233

This commit is contained in:
nick black 2022-02-11 03:11:58 -05:00 committed by nick black
parent 28756a004f
commit 6bf37089a1

22
src/tests/tabs.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <cstdlib>
#include "main.h"
TEST_CASE("TaBs") { // refreshing and delicious
auto nc_ = testing_notcurses();
if(!nc_){
return;
}
struct ncplane* n_ = notcurses_stdplane(nc_);
REQUIRE(n_);
SUBCASE("PutcTaB") {
unsigned y, x;
CHECK(1 == ncplane_putchar(n_, '\n'));
ncplane_cursor_yx(n_, &y, &x);
CHECK(y == 8);
CHECK(x == 0);
}
CHECK(0 == notcurses_stop(nc_));
}