summaryrefslogtreecommitdiff
path: root/tests/test_helpers.py
diff options
context:
space:
mode:
authorJan <59206115+Threated@users.noreply.github.com>2023-01-11 10:19:29 +0100
committerGitHub <noreply@github.com>2023-01-11 11:19:29 +0200
commit4a825bc76b668951923c57aaff1020c3892f8de2 (patch)
treef39c9cfcf22579f9242df20757ad358e417f25a4 /tests/test_helpers.py
parentf46d7f3ef7ce64f90acd4a3dcc14375ab9ae9c9d (diff)
downloadredis-py-4a825bc76b668951923c57aaff1020c3892f8de2.tar.gz
String cleanse (#2548)
* Fixed string escape and added tests * Add Change * Name change
Diffstat (limited to 'tests/test_helpers.py')
-rw-r--r--tests/test_helpers.py6
1 files changed, 6 insertions, 0 deletions
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"'