commit b1f546c2ced23f5004b6deabfeaf5b7d55c314bf
parent c62d8beee782b52b9cee79379fe55a284d22f719
Author: Sebastian <sebastian@sebsite.pw>
Date: Fri, 13 May 2022 23:34:48 -0400
hare::lex+test: better error message
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/hare/lex/+test.ha b/hare/lex/+test.ha
@@ -73,6 +73,10 @@ fn lextest(in: str, expected: []token) void = {
fmt::errorfln("{}: {}", i, strerror(err))!;
abort();
};
+ if (tl.0 != etok.0) {
+ fmt::errorfln("Expected {}, got {}",
+ tokstr(etok), tokstr(tl))!;
+ };
assert(tl.0 == etok.0);
vassert(tl.1, etok.1);
if (tl.2.line != etok.2.line || tl.2.col != etok.2.col