def test_sorted_2(): stream = Stream([3, 1, 2, 8, 5, 6]) r = stream.sorted(reverse=True).toList() assert r == [8, 6, 5, 3, 2, 1]
def test_sorted_3(): stream = Stream(['aa', 'bbb', 'c', 'dddd']) r = stream.sorted(key=len).toList() assert r == ['c', 'aa', 'bbb', 'dddd']
def test_sorted_1(): stream = Stream([3, 1, 2, 8, 5, 6]) r = stream.sorted().toList() assert r == [1, 2, 3, 5, 6, 8]