fix(test): expect_eq on strings compares their text and prints both on a failure
It lowered to an i32 compare of two pointers, which the IR refused. Two strings with the same text are equal now, a null only to a null, and a failure says expect_eq failed (got "camp", want "lake"). examples/library/testing_strings.ludic (two tests fail on purpose, and the output is checked); ludic.base's actions_test uses it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
55c1de8734
commit
2fdefa6040
9 changed files with 22471 additions and 21866 deletions
|
|
@ -108,6 +108,7 @@ function emit_test_runner() -> void {
|
|||
var i = 0
|
||||
while i < len(g_tests) { emit_test_fn(g_tests[i], i); i += 1 }
|
||||
if g_uses_expect { emith("@.fmt_expect = private unnamed_addr constant [22 x i8] c\"%s (got %d, want %d)\\0A\\00\"\n") }
|
||||
if g_uses_expect_str { emith("@.fmt_expect_str = private unnamed_addr constant [26 x i8] c\"%s (got \\22%s\\22, want \\22%s\\22)\\0A\\00\"\n") }
|
||||
if g_uses_expect_fp { emith("@.fmt_expect_fp = private unnamed_addr constant [22 x i8] c\"%s (got %g, want %g)\\0A\\00\"\n") }
|
||||
|
||||
ll_t = 0; ll_lbl = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue