mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
e6637e81cc
* CMake: add USE_PANDOC, USE_DOXYGEN options #101 * README: mention rust * start integrating rust into build #101 * CMake: add USE_NETWORK option for cargo * Debian: build-dep on doxygen * rust: colloquy checks in Cargo.lock * extract NCKEY defines into their own include * colloquy: use clap to parse CLI args * CMake: unify option namespace * Python: update include path * Rust: fix up --frozen workings for -DUSE_NETWORK=off * CMake: abstract out colloquy a little * Sync direct.hh to the New Way
33 lines
822 B
C++
33 lines
822 B
C++
#include "main.h"
|
|
|
|
TEST_CASE("DirectMode") {
|
|
// common initialization
|
|
if(getenv("TERM") == nullptr){
|
|
return;
|
|
}
|
|
FILE* outfp_{};
|
|
outfp_ = fopen("/dev/tty", "wb");
|
|
REQUIRE(nullptr != outfp_);
|
|
struct ncdirect* nc_ = notcurses_directmode(NULL, outfp_);
|
|
REQUIRE(nullptr != nc_);
|
|
|
|
SUBCASE("SetItalic") {
|
|
CHECK(0 == ncdirect_styles_set(nc_, NCSTYLE_ITALIC));
|
|
CHECK(0 == ncdirect_styles_off(nc_, NCSTYLE_ITALIC));
|
|
}
|
|
|
|
SUBCASE("SetBold") {
|
|
CHECK(0 == ncdirect_styles_set(nc_, NCSTYLE_BOLD));
|
|
CHECK(0 == ncdirect_styles_off(nc_, NCSTYLE_BOLD));
|
|
}
|
|
|
|
SUBCASE("SetUnderline") {
|
|
CHECK(0 == ncdirect_styles_set(nc_, NCSTYLE_UNDERLINE));
|
|
CHECK(0 == ncdirect_styles_off(nc_, NCSTYLE_UNDERLINE));
|
|
}
|
|
|
|
// common teardown
|
|
CHECK(0 == ncdirect_stop(nc_));
|
|
CHECK(0 == fclose(outfp_));
|
|
}
|