'Test the handling of negation and sorting together.
If a string ends with a sorting suffix, it takes precedence over the
NotQuery parsing.'

def test_negation_interaction(self):

    (query, sort) = beets.library.parse_query_string(u'-bar+', beets.library.Item)
    self.assertEqual(len(query.subqueries), 1)
    self.assertTrue(isinstance(query.subqueries[0], dbcore.query.TrueQuery))
    self.assertTrue(isinstance(sort, dbcore.query.SlowFieldSort))
    self.assertEqual(sort.field, u'-bar')
