File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 13130/1/2, ``bitonic_sort`` needs a power-of-two length, ``topological_sort`` works
1414on a graph, and ``stalin_sort``/``wiggle_sort`` deliberately do not fully sort).
1515"""
16+ from dataclasses import dataclass
17+ typing import NamedTuple
1618
1719import pytest
1820
@@ -69,6 +71,17 @@ def test_heap_sort():
6971 strand_sort ,
7072)
7173
74+ @dataclass
75+ class Person :
76+ name : str = "Bob"
77+ age : int = 37
78+ cost : float = 0.0
79+
80+ class Dog (NamedTuple ):
81+ name : str = "Fido"
82+ age : int = 5
83+ weight : float = 15.5
84+
7285CASES = (
7386 [],
7487 [1 ],
@@ -79,6 +92,8 @@ def test_heap_sort():
7992 [5 , 4 , 3 , 2 , 1 ],
8093 [1 , 2 , 3 , 4 , 5 ],
8194 [- 2 , - 2 , 0 , 0 , 7 , 7 ],
95+ [Person (cost = 100.0 ), Person (cost = - 100.0 ), Person (name = "Al" )],
96+ [Dog (weight = 15.5 ), Dog (weight = 15.1 ), Dog (name = "Buddy" )],
8297)
8398
8499
You can’t perform that action at this time.
0 commit comments