This is an automated email from the ASF dual-hosted git repository.
willholley pushed a commit to branch mango-beginswith
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/mango-beginswith by this push:
new b07e0673f additional special character tests
b07e0673f is described below
commit b07e0673f2f2d18ff5304b0380d04f20b0f0bf24
Author: Will Holley <[email protected]>
AuthorDate: Thu Oct 26 14:32:57 2023 +0000
additional special character tests
---
src/mango/test/03-operator-test.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/mango/test/03-operator-test.py
b/src/mango/test/03-operator-test.py
index 3b1a46565..8d216d9d8 100644
--- a/src/mango/test/03-operator-test.py
+++ b/src/mango/test/03-operator-test.py
@@ -143,19 +143,19 @@ class BaseOperatorTests:
self.assertNotIn("twitter", d)
def test_beginswith(self):
+ self.db.save_docs(
+ [
+ {"user_id": 99, "location": {"state": ":Bar"}},
+ ]
+ )
+
cases = [
{"prefix": "New", "user_ids": [2, 10]},
- {
- # test escaped characters - note the space in the test
string
- "prefix": "New ",
- "user_ids": [2, 10],
- },
- {
- # non-string values in documents should not match the
prefix,
- # but should not error
- "prefix": "Foo",
- "user_ids": [],
- },
+ # test characters that require escaping
+ {"prefix": "New ", "user_ids": [2, 10]},
+ {"prefix": ":", "user_ids": [99]},
+ {"prefix": "Foo", "user_ids": []},
+ {"prefix": '"Foo', "user_ids": []},
{"prefix": " New", "user_ids": []},
]