summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2021-05-15 09:12:26 +0300
committerGitHub <noreply@github.com>2021-05-15 08:12:26 +0200
commit3824fd3f9a303bc885a6f1f2eb7aa28fb5460cb7 (patch)
tree1e82c68839647836c6bae789ce939035aa28b305 /tests
parent1568ae23c66c572891207f2c1d330d246b3144ac (diff)
downloadNim-3824fd3f9a303bc885a6f1f2eb7aa28fb5460cb7.tar.gz
RST opt.list to have priority over def.list (#17845)
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/trst.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/stdlib/trst.nim b/tests/stdlib/trst.nim
index 905e5143a..e6c5d9700 100644
--- a/tests/stdlib/trst.nim
+++ b/tests/stdlib/trst.nim
@@ -1,6 +1,8 @@
 discard """
   output: '''
 
+[Suite] RST parsing
+
 [Suite] RST indentation
 
 [Suite] RST include directive
@@ -55,6 +57,30 @@ proc toAst(input: string,
   except EParseError:
     discard
 
+suite "RST parsing":
+  test "option list has priority over definition list":
+    check(dedent"""
+        --defusages
+                      file
+        -o            set
+        """.toAst ==
+      dedent"""
+        rnOptionList
+          rnOptionListItem  order=1
+            rnOptionGroup
+              rnLeaf  '--'
+              rnLeaf  'defusages'
+            rnDescription
+              rnInner
+                rnLeaf  'file'
+          rnOptionListItem  order=2
+            rnOptionGroup
+              rnLeaf  '-'
+              rnLeaf  'o'
+            rnDescription
+              rnLeaf  'set'
+        """)
+
 suite "RST indentation":
   test "nested bullet lists":
     let input = dedent """