summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-08 22:40:27 +0800
committerGitHub <noreply@github.com>2023-01-08 15:40:27 +0100
commita55604a3d8605e398f27df364cc215b7114395eb (patch)
treeff92991c2e53b53b3c10e59646a6693c58bc015b /tests
parent76e4f8afb1423eb04f26059f1ed01ca0375bee63 (diff)
downloadNim-a55604a3d8605e398f27df364cc215b7114395eb.tar.gz
fixes #21232; highlite.getNextToken() returns gtOperator for '/' in C (#21234)
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/thighlite.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/stdlib/thighlite.nim b/tests/stdlib/thighlite.nim
index 5134215c1..d88bc7fec 100644
--- a/tests/stdlib/thighlite.nim
+++ b/tests/stdlib/thighlite.nim
@@ -1,6 +1,7 @@
 
 import unittest, strutils
 import ../../lib/packages/docutils/highlite
+import std/objectdollar
 
 block: # Nim tokenizing
   test "string literals and escape seq":
@@ -30,3 +31,12 @@ block: # Cmd (shell) tokenizing
         ("file.nim", gtIdentifier), ("\n", gtWhitespace),
         ("out: file [SuccessX]", gtProgramOutput)
       ])
+
+block: # bug #21232
+  let code = "/"
+  var toknizr: GeneralTokenizer
+
+  initGeneralTokenizer(toknizr, code)
+
+  getNextToken(toknizr, langC)
+  check $toknizr == """(kind: gtOperator, start: 0, length: 1, buf: "/", pos: 1, state: gtEof, lang: langC)"""