You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
758 B
C++
34 lines
758 B
C++
5 years ago
|
#include "main.h"
|
||
|
#include <cstring>
|
||
|
#include <iostream>
|
||
|
|
||
|
TEST_CASE("Plot") {
|
||
|
if(!enforce_utf8()){
|
||
|
return;
|
||
|
}
|
||
|
if(getenv("TERM") == nullptr){
|
||
|
return;
|
||
|
}
|
||
|
notcurses_options nopts{};
|
||
|
nopts.inhibit_alternate_screen = true;
|
||
|
nopts.suppress_banner = true;
|
||
|
FILE* outfp_ = fopen("/dev/tty", "wb");
|
||
|
REQUIRE(outfp_);
|
||
|
struct notcurses* nc_ = notcurses_init(&nopts, outfp_);
|
||
|
REQUIRE(nc_);
|
||
|
struct ncplane* n_ = notcurses_stdplane(nc_);
|
||
|
REQUIRE(n_);
|
||
|
REQUIRE(0 == ncplane_cursor_move_yx(n_, 0, 0));
|
||
|
|
||
|
SUBCASE("SimplePlot"){
|
||
|
ncplot_options popts{};
|
||
|
ncplot* p = ncplot_create(n_, &popts);
|
||
|
REQUIRE(p);
|
||
|
CHECK(n_ == ncplot_plane(p));
|
||
|
ncplot_destroy(p);
|
||
|
}
|
||
|
|
||
|
CHECK(0 == notcurses_stop(nc_));
|
||
|
CHECK(0 == fclose(outfp_));
|
||
|
}
|