summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Cappello <briancappello@gmail.com>2018-08-14 19:21:16 -0600
committerBrian Cappello <briancappello@gmail.com>2018-08-14 19:21:16 -0600
commit41140232602ce150756e417d22f98cac419789d6 (patch)
tree46efb30e284042ba6e20b90dc55f1c652fa73990 /tests
parenta865f8ef86f687c06b36ec178c2021ce0c368c63 (diff)
downloadbabel-41140232602ce150756e417d22f98cac419789d6.tar.gz
add support to util.pathmatch for matching the start of a string
Diffstat (limited to 'tests')
-rw-r--r--tests/test_util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index a3607d5..ef59110 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -31,6 +31,11 @@ def test_pathmatch():
assert not util.pathmatch('**.py', 'templates/index.html')
assert util.pathmatch('**/templates/*.html', 'templates/index.html')
assert not util.pathmatch('**/templates/*.html', 'templates/foo/bar.html')
+ assert util.pathmatch('^foo/**.py', 'foo/bar/baz/blah.py')
+ assert not util.pathmatch('^foo/**.py', 'blah/foo/bar/baz.py')
+ assert util.pathmatch('./foo/**.py', 'foo/bar/baz/blah.py')
+ assert util.pathmatch('./blah.py', 'blah.py')
+ assert not util.pathmatch('./foo/**.py', 'blah/foo/bar/baz.py')
def test_odict_pop():