summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_graph.py2
-rw-r--r--tests/test_helpers.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_graph.py b/tests/test_graph.py
index d71df48..4721b2f 100644
--- a/tests/test_graph.py
+++ b/tests/test_graph.py
@@ -124,7 +124,7 @@ def test_path(client):
@pytest.mark.redismod
def test_param(client):
- params = [1, 2.3, "str", True, False, None, [0, 1, 2]]
+ params = [1, 2.3, "str", True, False, None, [0, 1, 2], r"\" RETURN 1337 //"]
query = "RETURN $param"
for param in params:
result = client.graph().query(query, {"param": param})
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
index 3595829..57a94d2 100644
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -80,3 +80,9 @@ def test_quote_string():
assert quote_string("hello world!") == '"hello world!"'
assert quote_string("") == '""'
assert quote_string("hello world!") == '"hello world!"'
+ assert quote_string("abc") == '"abc"'
+ assert quote_string("") == '""'
+ assert quote_string('"') == r'"\""'
+ assert quote_string(r"foo \ bar") == r'"foo \\ bar"'
+ assert quote_string(r"foo \" bar") == r'"foo \\\" bar"'
+ assert quote_string('a"a') == r'"a\"a"'