aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stdlib/stdlib.c9
-rw-r--r--src/stdlib/stdlib.h4
2 files changed, 10 insertions, 3 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"
diff --git a/src/stdlib/stdlib.h b/src/stdlib/stdlib.h
index 725d5d03..aaa4a1d6 100644
--- a/src/stdlib/stdlib.h
+++ b/src/stdlib/stdlib.h
@@ -73,11 +73,11 @@ void end_inspect(const void *expr, const TypeInfo_t *type);
end_inspect(&_expr, typeinfo); \
}
__attribute__((nonnull))
-void test_value(const void *expr, const void *expected, const TypeInfo_t *type);
+void test_value(const char *filename, int64_t start, int64_t end, const void *expr, const void *expected, const TypeInfo_t *type);
#define test(expr, expected, typeinfo, start, end) {\
auto _expr = expr; \
auto _expected = expected; \
- test_value(&_expr, &_expected, typeinfo); \
+ test_value(__SOURCE_FILE__, start, end, &_expr, &_expected, typeinfo); \
}
void say(Text_t text, bool newline);