From e00d7b7ddcecd3696d93e0d22b3b05c0f1733ee4 Mon Sep 17 00:00:00 2001 From: Bruno Cauet Date: Wed, 18 Feb 2015 19:28:03 +0100 Subject: [PATCH] PathQuery: simple utf8 comparison Test usqge of SQL's substr() with a UTF8 example. The ideal would be to test with non-UTF8 code points, however it is impossible to perform such a query: queries can only be unicode or utf8. --- test/test_query.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_query.py b/test/test_query.py index c6aec6185..e53efc29f 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -474,6 +474,12 @@ class PathQueryTest(_common.LibTestCase, TestHelper, AssertsMixin): results = self.lib.items(q) self.assert_items_matched(results, ['path item', 'caps path']) + def test_utf8_bytes(self): + self.add_album(path=b'/\xc3\xa0/b/c.mp3', title='latin byte') + q = b'path:/\xc3\xa0/b/c.mp3' + results = self.lib.items(q) + self.assert_items_matched(results, ['latin byte']) + class IntQueryTest(unittest.TestCase, TestHelper):