Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

Commit 967d402

Browse files
committed
ref #80 add test
1 parent bd62719 commit 967d402

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/pytest/test.py

+13
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,19 @@ def testDoubleParse(self):
791791
self.assertEqual(1512060373.222988, float(res))
792792
self.assertEqual('1512060373.222988', res)
793793

794+
def testIssue_80(self):
795+
"""https://github.com/RedisJSON/RedisJSON2/issues/80"""
796+
797+
with self.redis() as r:
798+
r.client_setname(self._testMethodName)
799+
r.flushdb()
800+
801+
self.assertOk(r.execute_command('JSON.SET', 'test', '.', '[{"code":"1"}, {"code":"2"}]'))
802+
r.execute_command('JSON.GET', 'test', '.[?(@.code=="2")]')
803+
804+
# This shouldn't crash Redis
805+
r.execute_command('JSON.GET', 'test', '$.[?(@.code=="2")]')
806+
794807
#
795808
# class CacheTestCase(BaseReJSONTest):
796809
# @property

0 commit comments

Comments
 (0)