diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-04-07 20:58:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-07 20:58:26 +0300 |
commit | 39954739252fb5b77ba81b1e52d4bb9d16092c31 (patch) | |
tree | d336e014da2ce15119f02567084d04d8be26313d | |
parent | 3324afbd404a4237f0339e50a345a5f20c4ea7dd (diff) |
Fix unit_tests.py (#2065)
They were silently broken in 780e72 due to flag reordering. This commit
also includes a new assert that would avoid that kind of failure in the
future.
-rwxr-xr-x | tools/unit_tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/unit_tests.py b/tools/unit_tests.py index 76ecefbde..c77449759 100755 --- a/tools/unit_tests.py +++ b/tools/unit_tests.py @@ -18,6 +18,8 @@ def run_unit_test2(cmd): errcode = process.returncode if errcode != 0: sys.exit(errcode) + # To avoid the case where we silently filter out all tests. + assert expected > 0 if actual == None and expected == None: raise AssertionError("Bad js/unit_test.ts output") if expected != actual: @@ -32,7 +34,7 @@ def run_unit_test2(cmd): def run_unit_test(deno_exe, permStr, flags=None): if flags is None: flags = [] - cmd = [deno_exe, "js/unit_tests.ts"] + flags + [permStr] + cmd = [deno_exe] + flags + ["js/unit_tests.ts", permStr] run_unit_test2(cmd) @@ -48,7 +50,6 @@ def unit_tests(deno_exe): run_unit_test(deno_exe, "permR0W1N0E0U0", ["--allow-write"]) run_unit_test(deno_exe, "permR1W1N0E0U0", ["--allow-read", "--allow-write"]) - run_unit_test(deno_exe, "permR1W0N1E0U0", ["--allow-read", "--allow-net"]) run_unit_test(deno_exe, "permR0W0N0E1U0", ["--allow-env"]) run_unit_test(deno_exe, "permR0W0N0E0U1", ["--allow-run"]) run_unit_test(deno_exe, "permR0W1N0E0U1", ["--allow-run", "--allow-write"]) |