Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lang-agnostic tests for counting/accumulating commands/options.

  • Loading branch information...
commit cedb062d9e1544f4d57adf41619c911b7a965001 1 parent 52ce4e4
Vladimir Keleshev keleshev authored
Showing with 56 additions and 0 deletions.
  1. +56 −0 language_agnostic_test/language_agnostic_tester.py
56 language_agnostic_test/language_agnostic_tester.py
View
@@ -651,6 +651,62 @@
$ prog -vvvv
"user-error"
+#
+# Counting commands
+#
+
+r"""usage: prog [go]
+
+"""
+$ prog go
+{"go": true}
+
+
+r"""usage: prog [go go]
+
+"""
+$ prog
+{"go": 0}
+
+$ prog go
+{"go": 1}
+
+$ prog go go
+{"go": 2}
+
+$ prog go go go
+"user-error"
+
+r"""usage: prog go...
+
+"""
+$ prog go go go go go
+{"go": 5}
+
+
+#
+# test_accumulate_multiple_options
+#
+
+r"""usage: prog --long=<arg> ...
+
+"""
+$ prog --long one
+{"--long": ["one"]}
+
+$ prog --long one --long two
+{"--long": ["one", "two"]}
+
+
+#
+# test_multiple_different_elements
+#
+
+r"""usage: prog (go <direction> --speed=<km/h>)...
+
+"""
+$ prog go left --speed=5 go right --speed=9
+{"go": 2, "<direction>": ["left", "right"], "--speed": ["5", "9"]}
'''
import sys, json, re
Please sign in to comment.
Something went wrong with that request. Please try again.