ensure UTF8 for metric tests

This commit is contained in:
nick black 2020-04-18 01:39:34 -04:00
parent 305b517191
commit 11600b6820
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 5 additions and 4 deletions

View File

@ -25,8 +25,7 @@ TEST_CASE("Cell") {
if(getenv("TERM") == nullptr){
return;
}
FILE* outfp_{};
outfp_ = fopen("/dev/tty", "wb");
FILE* outfp_ = fopen("/dev/tty", "wb");
REQUIRE(nullptr != outfp_);
notcurses_options nopts{};
nopts.inhibit_alternate_screen = true;

View File

@ -5,8 +5,7 @@ TEST_CASE("DirectMode") {
if(getenv("TERM") == nullptr){
return;
}
FILE* outfp_{};
outfp_ = fopen("/dev/tty", "wb");
FILE* outfp_ = fopen("/dev/tty", "wb");
REQUIRE(nullptr != outfp_);
struct ncdirect* nc_ = ncdirect_init(NULL, outfp_);
REQUIRE(nullptr != nc_);

View File

@ -20,6 +20,9 @@ char* impericize_ncmetric(uintmax_t val, unsigned decimal, char* buf,
}
TEST_CASE("ncmetric") {
if(!enforce_utf8()){
return;
}
const char* decisep = localeconv()->decimal_point;
REQUIRE(decisep);
REQUIRE(1 == strlen(decisep));