enforce_utf8() for wide tests, duh

This commit is contained in:
nick black 2020-04-18 01:59:21 -04:00
parent 11600b6820
commit 0a6f5d1a9f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
4 changed files with 9 additions and 18 deletions

View File

@ -20,9 +20,6 @@ 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));

View File

@ -18,6 +18,9 @@ void BoxPermutationsRounded(struct notcurses* nc, struct ncplane* n, unsigned ed
}
TEST_CASE("NCPlane") {
if(!enforce_utf8()){
return;
}
if(getenv("TERM") == nullptr){
return;
}
@ -107,9 +110,6 @@ TEST_CASE("NCPlane") {
// Verify we can emit a multibyte character, and it advances the cursor
SUBCASE("EmitCell") {
if(!enforce_utf8()){
return;
}
const char cchar[] = "";
cell c{};
CHECK(strlen(cchar) == cell_load(n_, &c, cchar));
@ -123,9 +123,6 @@ TEST_CASE("NCPlane") {
// Verify we can emit a wchar_t, and it advances the cursor
SUBCASE("EmitWcharT") {
if(!enforce_utf8()){
return;
}
const wchar_t* w = L"";
int sbytes = 0;
CHECK(0 < ncplane_putwegc(n_, w, &sbytes));
@ -138,9 +135,6 @@ TEST_CASE("NCPlane") {
// Verify we can emit a multibyte string, and it advances the cursor
SUBCASE("EmitStr") {
if(!enforce_utf8()){
return;
}
const char s[] = "Σιβυλλα τι θελεις; respondebat illa: αποθανειν θελω.";
int wrote = ncplane_putstr(n_, s);
CHECK(strlen(s) == wrote);
@ -153,9 +147,6 @@ TEST_CASE("NCPlane") {
// Verify we can emit a wide string, and it advances the cursor
SUBCASE("EmitWideStr") {
if(!enforce_utf8()){
return;
}
const wchar_t s[] = L"Σιβυλλα τι θελεις; respondebat illa: αποθανειν θελω.";
int wrote = ncplane_putwstr(n_, s);
CHECK(0 < wrote);
@ -167,9 +158,6 @@ TEST_CASE("NCPlane") {
}
SUBCASE("EmitEmojiStr") {
if(!enforce_utf8()){
return;
}
const wchar_t e[] =
L"🍺🚬🌿💉💊🔫💣🤜🤛🐌🐎🐑🐒🐔🐗🐘🐙🐚"
"🐛🐜🐝🐞🐟🐠🐡🐢🐣🐤🐥🐦🐧🐨🐩🐫🐬🐭🐮"

View File

@ -4,6 +4,9 @@
#include "internal.h"
TEST_CASE("Scrolling") {
if(!enforce_utf8()){
return;
}
if(getenv("TERM") == nullptr){
return;
}

View File

@ -4,6 +4,9 @@
#include "internal.h"
TEST_CASE("Wide") {
if(!enforce_utf8()){
return;
}
if(getenv("TERM") == nullptr){
return;
}