Common (strutil): fixes unit tests

This commit is contained in:
李通洲
2026-05-28 22:41:47 +08:00
parent 0ef677a98c
commit 8fbc29a70c
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -7,6 +7,12 @@
#include "common/wcwidth.h"
#ifdef _WIN32
// #include <shlwapi.h>
__stdcall char* StrStrIA(const char* lpFirst, const char* lpSrch);
#define strcasestr StrStrIA
#endif
static inline bool ffStrSet(const char* str) {
if (str == NULL) {
return false;
+1 -1
View File
@@ -110,7 +110,7 @@ int main(void) {
uint8_t width = 0;
uint8_t bytes = ffUtf8CharLenWidth(emoji, 4, &width);
VERIFY(bytes == 4);
VERIFY(width == 2); // Most emoji are double-width
VERIFY(width == mk_wcwidth(0x1F600));
}
puts("\033[32mAll tests passed!" FASTFETCH_TEXT_MODIFIER_RESET);