From 790baae673fd60c36f47b9f9b31c9cf132ba3437 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 19 Aug 2018 03:00:34 -0400 Subject: Expose deno.exit() and add test. --- tools/util_test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tools/util_test.py') 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() -- cgit v1.2.3