From 8fbc29a70c073c79cd668001f34a5a88cf5b0264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 28 May 2026 22:41:47 +0800 Subject: [PATCH] Common (strutil): fixes unit tests --- src/common/strutil.h | 6 ++++++ tests/strutil.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/strutil.h b/src/common/strutil.h index 1bc77ecae..b8174b3fe 100644 --- a/src/common/strutil.h +++ b/src/common/strutil.h @@ -7,6 +7,12 @@ #include "common/wcwidth.h" +#ifdef _WIN32 +// #include +__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; diff --git a/tests/strutil.c b/tests/strutil.c index a225c5ff9..ed3ddae03 100644 --- a/tests/strutil.c +++ b/tests/strutil.c @@ -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);