[PATCH] Correct expected error loci in self-tests
Export this patch
---
test/subtest/success.fnl | 10 ++++ ------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/test/subtest/success.fnl b/test/subtest/success.fnl
index 915da4a..78b0ad0 100644
--- a/test/subtest/success.fnl
+++ b/test/subtest/success.fnl
@@ -18,12 +18,10 @@
(fn test-error []
(t.error "bummer" #(error))
- (t.error (.. (if _G.jit "" "%./test/subtest/success%.fnl:31: ")
- "oops")
- #(error "oops"))
- (t.error (.. (if _G.jit "" "%./test/subtest/success%.fnl:42: ")
- "oops")
- #(error "oops: bummer"))
+ (t.error (.. (if _G.jit "" "%./test/subtest/success%.fnl:30: ") "oops")
+ #(error "oops"))
+ (t.error (.. (if _G.jit "" "%./test/subtest/success%.fnl:40: ") "oops")
+ #(error "oops: bummer"))
The line numbers of 30 and 40 are actually the numbers in the Lua
output, not the numbers in the Fennel where the error actually
occurred. So I think I'll try to get `t.error' to use `fennel.traceback'
so the assertions can be based on the actual source line numbers instead.
thanks,
Phil
(t.error "1" #(error 1))
(t.error "%[0 1%]" #(error [0 1]))
(t.error "dang" #(error) "aye yay"))
--
2.44.0
Rudolf Adamkovič <rudolf@adamkovic.org> writes: