mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
enforce_utf8() for wide tests, duh
This commit is contained in:
parent
11600b6820
commit
0a6f5d1a9f
@ -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));
|
||||
|
@ -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"🍺🚬🌿💉💊🔫💣🤜🤛🐌🐎🐑🐒🐔🐗🐘🐙🐚"
|
||||
"🐛🐜🐝🐞🐟🐠🐡🐢🐣🐤🐥🐦🐧🐨🐩🐫🐬🐭🐮"
|
||||
|
@ -4,6 +4,9 @@
|
||||
#include "internal.h"
|
||||
|
||||
TEST_CASE("Scrolling") {
|
||||
if(!enforce_utf8()){
|
||||
return;
|
||||
}
|
||||
if(getenv("TERM") == nullptr){
|
||||
return;
|
||||
}
|
||||
|
@ -4,6 +4,9 @@
|
||||
#include "internal.h"
|
||||
|
||||
TEST_CASE("Wide") {
|
||||
if(!enforce_utf8()){
|
||||
return;
|
||||
}
|
||||
if(getenv("TERM") == nullptr){
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user