* highlite: fix #17890 - tokenize Nim escape seq-s * Update tests/stdlib/thighlite.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
parent
0dc534832e
commit
287f1170ba
2 changed files with 48 additions and 21 deletions
13
tests/stdlib/thighlite.nim
Normal file
13
tests/stdlib/thighlite.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
import unittest
|
||||
import ../../lib/packages/docutils/highlite
|
||||
|
||||
block: # Nim tokenizing"
|
||||
test "string literals and escape seq":
|
||||
check("\"ok1\\nok2\\nok3\"".tokenize(langNim) ==
|
||||
@[("\"ok1", gtStringLit), ("\\n", gtEscapeSequence), ("ok2", gtStringLit),
|
||||
("\\n", gtEscapeSequence), ("ok3\"", gtStringLit)
|
||||
])
|
||||
check("\"\"\"ok1\\nok2\\nok3\"\"\"".tokenize(langNim) ==
|
||||
@[("\"\"\"ok1\\nok2\\nok3\"\"\"", gtLongStringLit)
|
||||
])
|
||||
Loading…
Add table
Add a link
Reference in a new issue