summaryrefslogtreecommitdiff
path: root/tools/util_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util_test.py')
-rwxr-xr-xtools/util_test.py28
1 files changed, 2 insertions, 26 deletions
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')