diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 14:12:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 14:12:00 -0400 |
| commit | f3af7e65f4d83f6b02e1158500122cd97962f313 (patch) | |
| tree | 2d6162fdf36a53e4c52453f805bcd155ba2b43f6 /src/stdlib/stdlib.c | |
| parent | 4d59fc2987e52da0274e6b204a9d2885613f74b7 (diff) | |
Show full doctest inspection if test fails
Diffstat (limited to 'src/stdlib/stdlib.c')
| -rw-r--r-- | src/stdlib/stdlib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stdlib/stdlib.c b/src/stdlib/stdlib.c index 77383cd1..2177397d 100644 --- a/src/stdlib/stdlib.c +++ b/src/stdlib/stdlib.c @@ -576,7 +576,7 @@ public void end_inspect(const void *expr, const TypeInfo_t *type) } __attribute__((nonnull)) -public void test_value(const void *expr, const void *expected, const TypeInfo_t *type) +public void test_value(const char *filename, int64_t start, int64_t end, const void *expr, const void *expected, const TypeInfo_t *type) { Text_t expr_text = generic_as_text(expr, USE_COLOR, type); Text_t expected_text = generic_as_text(expected, USE_COLOR, type); @@ -584,6 +584,13 @@ public void test_value(const void *expr, const void *expected, const TypeInfo_t bool success = Text$equal_values(expr_text, expected_text); if (!success) { print_stack_trace(stderr, 2, 4); + fprint(stderr, ""); + fflush(stderr); + + start_inspect(filename, start, end); + end_inspect(expr, type); + fflush(stdout); + if (USE_COLOR) { fprint(stderr, "\n\x1b[31;7m ==================== TEST FAILED ==================== \x1b[0;1m\n\n" |
