aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authornatsuoto <[email protected]>2026-07-11 17:10:05 +0530
committernatsuoto <[email protected]>2026-07-11 17:10:05 +0530
commitef2e40b7eb1c5c29a9ec5f203e2927dc42a533e2 (patch)
treefd1ad74c079af76f6d1d31d8920ec6b212ca3851 /tests
parentef0d136cb9c6517c39bf0d693663034791eb0508 (diff)
downloadedify-ef2e40b7eb1c5c29a9ec5f203e2927dc42a533e2.tar.xz
edify-ef2e40b7eb1c5c29a9ec5f203e2927dc42a533e2.zip
refactor(library): rewrite geo/postal to inline patterns; delete RegexBackedPattern escape hatch
Diffstat (limited to 'tests')
-rw-r--r--tests/library/media/regex.test.py13
-rw-r--r--tests/library/password.test.py4
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/library/media/regex.test.py b/tests/library/media/regex.test.py
new file mode 100644
index 0000000..c1c687c
--- /dev/null
+++ b/tests/library/media/regex.test.py
@@ -0,0 +1,13 @@
+from edify.library import regex
+
+
+def test_valid_regex():
+ assert regex(r"^\d+$")
+
+
+def test_invalid_regex():
+ assert not regex(r"(?P<name>")
+
+
+def test_non_string():
+ assert not regex(42)
diff --git a/tests/library/password.test.py b/tests/library/password.test.py
index ec3b627..45b1672 100644
--- a/tests/library/password.test.py
+++ b/tests/library/password.test.py
@@ -13,3 +13,7 @@ def test_password():
)
is False
)
+
+
+def test_password_rejects_non_string():
+ assert password(42) is False