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.
This commit is contained in:
Bruno Cauet 2015-02-18 19:28:03 +01:00
parent 6fc678e947
commit e00d7b7ddc

View file

@ -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):