Skip to content

Commit 06f5504

Browse files
committed
add a little bit more information into the test failure messages
related to #14
1 parent 6204634 commit 06f5504

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

syntax-color-test/tests/syntax-color/scribble-lexer.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
(port-count-lines! in)
1414
(let loop ([mode #f])
1515
(let-values ([(lexeme type paren start end backup mode) (lexer in 0 mode)])
16+
(when (and (= start end) (not (equal? type 'eof)))
17+
(error 'color "lexer returned a token with zero width, start ~s end ~s"
18+
start end))
1619
(if (eq? type 'eof)
1720
null
1821
(cons (list start end type backup)
@@ -29,7 +32,7 @@
2932
(caddar l)))
3033
(loop (+ (+ pos (caar l))) (cdr l)))))])
3134
(unless (equal? v val)
32-
(eprintf "FAILED, line ~s\n" line)
35+
(eprintf "FAILED, line ~s, current-lexer-char ~s\n" line (current-lexer-char))
3336
(cond [(string? v)
3437
(eprintf "~a\nexpected\n" v)]
3538
[else

0 commit comments

Comments
 (0)