From acee1944b9419e101f515a501b11653af8229258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 10 Sep 2019 17:09:54 +0200 Subject: feat: Make integration tests rust unit tests (#2884) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- tools/util_test.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'tools/util_test.py') diff --git a/tools/util_test.py b/tools/util_test.py index 0a718f1d9..4a545ff1c 100755 --- a/tools/util_test.py +++ b/tools/util_test.py @@ -2,35 +2,11 @@ import os from test_util import DenoTestCase, run_tests -from util import (pattern_match, parse_exit_code, shell_quote_win, - parse_wrk_output, root_path) +from util import (parse_exit_code, shell_quote_win, parse_wrk_output, + root_path) class TestUtil(DenoTestCase): - def test_pattern_match(self): - # yapf: disable - fixtures = [("foobarbaz", "foobarbaz", True), - ("[WILDCARD]", "foobarbaz", True), - ("foobar", "foobarbaz", False), - ("foo[WILDCARD]baz", "foobarbaz", True), - ("foo[WILDCARD]baz", "foobazbar", False), - ("foo[WILDCARD]baz[WILDCARD]qux", "foobarbazqatqux", True), - ("foo[WILDCARD]", "foobar", True), - ("foo[WILDCARD]baz[WILDCARD]", "foobarbazqat", True)] - # yapf: enable - - # Iterate through the fixture lists, testing each one - for (pattern, string, expected) in fixtures: - actual = pattern_match(pattern, string) - assert expected == actual, \ - "expected %s for\nExpected:\n%s\nTo equal actual:\n%s" % ( - expected, pattern, string) - - assert pattern_match("foo[BAR]baz", "foobarbaz", - "[BAR]") == True, "expected wildcard to be set" - assert pattern_match("foo[BAR]baz", "foobazbar", - "[BAR]") == False, "expected wildcard to be set" - def test_parse_exit_code(self): assert 54 == parse_exit_code('hello_error54_world') assert 1 == parse_exit_code('hello_error_world') -- cgit v1.2.3