summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-04-18 16:10:09 +0100
committerMichael Williamson <mike@zwobble.org>2020-04-18 16:10:09 +0100
commit3bda4eb739f6fcc412e17d71238797f48515addb (patch)
treefdfa599e6867c7aaf6f8da85db962b9183694382 /tests
parentf979936faf70c3f6c9f412d4a6f56e20f479af22 (diff)
Add extra regex test cases
Diffstat (limited to 'tests')
-rw-r--r--tests/jq_tests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/jq_tests.py b/tests/jq_tests.py
index 6084d91..4c37591 100644
--- a/tests/jq_tests.py
+++ b/tests/jq_tests.py
@@ -30,6 +30,16 @@ def can_use_regexes():
jq('test(".*")').transform("42")
)
+ assert_equal(
+ True,
+ jq('test("^[0-9]+$")').transform("42")
+ )
+
+ assert_equal(
+ False,
+ jq('test("^[0-9]+$")').transform("42a")
+ )
+
@istest
def input_string_is_parsed_to_json_if_raw_input_is_true():
@@ -108,7 +118,7 @@ def errors_do_not_leak_between_transformations():
assert False, "Expected error"
except ValueError as error:
pass
-
+
assert_equal(1, program.transform({"x": 1}))