summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/thighlite.nim17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/stdlib/thighlite.nim b/tests/stdlib/thighlite.nim
index f26ea93e4..4113a6a80 100644
--- a/tests/stdlib/thighlite.nim
+++ b/tests/stdlib/thighlite.nim
@@ -1,8 +1,8 @@
 
-import unittest
+import unittest, strutils
 import ../../lib/packages/docutils/highlite
 
-block: # Nim tokenizing"
+block: # Nim tokenizing
   test "string literals and escape seq":
     check("\"ok1\\nok2\\nok3\"".tokenize(langNim) ==
        @[("\"ok1", gtStringLit), ("\\n", gtEscapeSequence), ("ok2", gtStringLit),
@@ -11,3 +11,16 @@ block: # Nim tokenizing"
     check("\"\"\"ok1\\nok2\\nok3\"\"\"".tokenize(langNim) ==
        @[("\"\"\"ok1\\nok2\\nok3\"\"\"", gtLongStringLit)
       ])
+
+block: # Cmd (shell) tokenizing
+  test "cmd with dollar and output":
+    check(
+      dedent"""
+        $ nim c file.nim
+        out: file [SuccessX]"""
+        .tokenize(langConsole) ==
+      @[("$ ", gtPrompt), ("nim", gtProgram),
+        (" ", gtWhitespace), ("c", gtOption), (" ", gtWhitespace),
+        ("file.nim", gtIdentifier), ("\n", gtWhitespace),
+        ("out: file [SuccessX]", gtProgramOutput)
+      ])