From ed02991af9381e77bcf13b831de9855b38d581a3 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 26 Sep 2026 18:31:53 -0400 Subject: [PATCH] Make `STRCMP` and `STRICMP` tests more precise --- test/asm/string-compare.asm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/asm/string-compare.asm b/test/asm/string-compare.asm index 812d9a01..e7f04b4c 100644 --- a/test/asm/string-compare.asm +++ b/test/asm/string-compare.asm @@ -6,10 +6,19 @@ assert "a" === "b" == 0 assert 1 == "a" !== "b" assert 1 + 2 * 3 ** "x" !== "y" == 7 +assert !STRCMP("Hello", "Hello") +assert !STRCMP("", "") +assert STRCMP("hello", "HELLO") == 1 +assert STRCMP("HELLO", "hello") == -1 +assert STRCMP("hell", "hello") == -1 +assert STRCMP("hello", "hell") == 1 +assert STRCMP("hello", "goodbye") == 1 + assert !STRICMP("hello", "hello") assert !STRICMP("hello", "HELLO") assert !STRICMP("HeLlO", "hElLo") -assert STRICMP("HELLO", "goodBYE") > 0 -assert STRICMP("hello", "GOODbye") > 0 -assert STRICMP("", "hello") < 0 -assert STRICMP("hello", "") > 0 +assert !STRICMP("", "") +assert STRICMP("HELLO", "goodBYE") == 1 +assert STRICMP("hello", "GOODbye") == 1 +assert STRICMP("", "hello") == -1 +assert STRICMP("hello", "") == 1