1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-27 16:10:57 -05:00
denoland-deno/tools/util_test.py
Valentin Anger 31f32ed8c4
Move benchmarks to Rust (#7134)
All benchmarks are done in Rust and can be invoked with
`cargo bench`.

Currently this has it's own "harness" that behaves like
`./tools/benchmark.py` did.
Because of this tests inside `cli/bench` are currently not run.
This should be switched to the language provided harness
once the `#[bench]` attribute has been stabilized.
2020-08-28 09:03:50 -04:00

28 lines
978 B
Python
Executable file

# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import os
from test_util import DenoTestCase, run_tests
from util import (parse_exit_code, shell_quote_win, root_path)
class TestUtil(DenoTestCase):
def test_parse_exit_code(self):
assert parse_exit_code('hello_error54_world') == 54
assert parse_exit_code('hello_error_world') == 1
assert parse_exit_code('hello_world') == 0
def test_shell_quote_win(self):
assert shell_quote_win('simple') == 'simple'
assert shell_quote_win(
'roof/\\isoprojection') == 'roof/\\isoprojection'
assert shell_quote_win('with space') == '"with space"'
assert shell_quote_win('embedded"quote') == '"embedded""quote"'
assert shell_quote_win(
'a"b""c\\d\\"e\\\\') == '"a""b""""c\\d\\\\""e\\\\\\\\"'
def test_executable_exists(self):
assert os.path.exists(self.deno_exe)
if __name__ == '__main__':
run_tests()