summaryrefslogtreecommitdiff
path: root/tools/util_test.py
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-09-25 13:30:09 -0700
committerBert Belder <bertbelder@gmail.com>2018-09-26 09:52:30 -0700
commit1b9424e9d78990100ac82697a20515f9cb9e8335 (patch)
treec8149dcb803b094ef341cb025702a8ad6fd02685 /tools/util_test.py
parent3a6da19eb80c5959e0fe0ff00b093b9f7d85d618 (diff)
tools: add shell_quote() utility function
Diffstat (limited to 'tools/util_test.py')
-rw-r--r--tools/util_test.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/util_test.py b/tools/util_test.py
index 308951bc2..e40d0aed0 100644
--- a/tools/util_test.py
+++ b/tools/util_test.py
@@ -1,5 +1,5 @@
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
-from util import pattern_match, parse_exit_code
+from util import pattern_match, parse_exit_code, shell_quote_win
def pattern_match_test():
@@ -34,9 +34,20 @@ def parse_exit_code_test():
assert 0 == parse_exit_code('hello_world')
+def shell_quote_win_test():
+ print "Testing util.shell_quote_win()..."
+ assert 'simple' == shell_quote_win('simple')
+ assert 'roof/\\isoprojection' == shell_quote_win('roof/\\isoprojection')
+ assert '"with space"' == shell_quote_win('with space')
+ assert '"embedded""quote"' == shell_quote_win('embedded"quote')
+ assert '"a""b""""c\\d\\\\""e\\\\\\\\"' == shell_quote_win(
+ 'a"b""c\\d\\"e\\\\')
+
+
def util_test():
pattern_match_test()
parse_exit_code_test()
+ shell_quote_win_test()
if __name__ == '__main__':