Redis sets are unordered. In Redis 4.0 the Lua API silently sorted
sets before returning them, but since Redis 5.0 the sorting is no
longer performed.[1]
One of the tests broke on Redis 6.2.7 because the order changed. Sort
the lists before comparing them to fix this.
(It's only strictly necessary to sort when there are 2+ elements, but
for consistency this commit also sorts when there is just 1 element.
Empty sets are special because an empty Lua table is converted to a
Python dict rather than a list; this commit does not sort empty sets
to avoid masking this idiosyncrasy.)
…ailing test on Redis 6.2.7
Redis sets are unordered. In Redis 4.0 the Lua API silently sorted sets before returning them, but since Redis 5.0 the sorting is no longer performed.[1]
One of the tests broke on Redis 6.2.7 because the order changed. Sort the lists before comparing them to fix this.
(It's only strictly necessary to sort when there are 2+ elements, but for consistency this commit also sorts when there is just 1 element. Empty sets are special because an empty Lua table is converted to a Python dict rather than a list; this commit does not sort empty sets to avoid masking this idiosyncrasy.)
[1]: https://redis.io/docs/manual/programmability/eval-intro/