summaryrefslogtreecommitdiff
path: root/tools/util_test.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-08-19 03:00:34 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-08-21 18:34:56 -0400
commit790baae673fd60c36f47b9f9b31c9cf132ba3437 (patch)
tree8ffd1f1932e8fe0144e5920551449ac1417c68e9 /tools/util_test.py
parent18d495c7d17cf3fce3835e732094d058f51eddaa (diff)
Expose deno.exit() and add test.
Diffstat (limited to 'tools/util_test.py')
-rw-r--r--tools/util_test.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/util_test.py b/tools/util_test.py
index 3315a4eaf..308951bc2 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
+from util import pattern_match, parse_exit_code
def pattern_match_test():
@@ -27,5 +27,17 @@ def pattern_match_test():
"[BAR]") == False, "expected wildcard to be set"
+def parse_exit_code_test():
+ print "Testing util.parse_exit_code()..."
+ assert 54 == parse_exit_code('hello_error54_world')
+ assert 1 == parse_exit_code('hello_error_world')
+ assert 0 == parse_exit_code('hello_world')
+
+
def util_test():
pattern_match_test()
+ parse_exit_code_test()
+
+
+if __name__ == '__main__':
+ util_test()