diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 23:32:02 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 23:32:02 -0400 |
| commit | f60edfbe7f7fe4a3f62228aeafc18a1819de5319 (patch) | |
| tree | 48a17e39f866043577bf89ac6ee08c075bf276de /builtins | |
| parent | b8bb4ada8b28e761f09e40618550684fae80249f (diff) | |
Improve codegen for doctests a little bit by using __SOURCE_FILE__ macro
and making assignments use (x = 4, &x) syntax instead of ({ x = 4; &x })
Diffstat (limited to 'builtins')
| -rw-r--r-- | builtins/functions.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtins/functions.h b/builtins/functions.h index 96837249..d6b4c4b5 100644 --- a/builtins/functions.h +++ b/builtins/functions.h @@ -18,9 +18,9 @@ void fail_source(const char *filename, int64_t start, int64_t end, const char *f Text_t builtin_last_err(); void start_test(const char *filename, int64_t start, int64_t end); void end_test(void *expr, const TypeInfo *type, const char *expected, const char *filename, int64_t start, int64_t end); -#define test(expr, type, expected, filename, start, end) {\ - start_test(filename, start, end); \ - end_test(expr, type, expected, filename, start, end); } +#define test(expr, type, expected, start, end) {\ + start_test(__SOURCE_FILE__, start, end); \ + end_test(expr, type, expected, __SOURCE_FILE__, start, end); } void say(Text_t text, bool newline); uint64_t generic_hash(const void *obj, const TypeInfo *type); |
