summaryrefslogtreecommitdiff
path: root/test/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/utf8.c')
-rw-r--r--test/utf8.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/utf8.c b/test/utf8.c
index 5b020c3..88e6a8c 100644
--- a/test/utf8.c
+++ b/test/utf8.c
@@ -3,10 +3,12 @@
#include "test.h"
#include "wchar.h"
+#include <string.h>
+
void test_nchars_nbytes() {
- ASSERT(utf8_nchars((uint8_t *)"👴", 2) == 1,
+ ASSERT(utf8_nchars((uint8_t *)"👴", strlen("👴")) == 1,
"Expected old man emoji to be 1 char");
- ASSERT(utf8_nbytes((uint8_t *)"👴", 1) == 4,
+ ASSERT(utf8_nbytes((uint8_t *)"👴", strlen("👴"), 1) == 4,
"Expected old man emoji to be 4 bytes");
}