File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414on a graph, and ``stalin_sort``/``wiggle_sort`` deliberately do not fully sort).
1515"""
1616
17+ from dataclasses import dataclass
18+ from typing import NamedTuple
19+
1720import pytest
1821
1922from sorts .binary_insertion_sort import binary_insertion_sort
@@ -69,6 +72,20 @@ def test_heap_sort():
6972 strand_sort ,
7073)
7174
75+
76+ @dataclass (order = True )
77+ class Person :
78+ name : str = "Bob"
79+ age : int = 37
80+ cost : float = 0.0
81+
82+
83+ class Dog (NamedTuple ):
84+ name : str = "Fido"
85+ age : int = 5
86+ weight : float = 15.5
87+
88+
7289CASES = (
7390 [],
7491 [1 ],
@@ -79,6 +96,8 @@ def test_heap_sort():
7996 [5 , 4 , 3 , 2 , 1 ],
8097 [1 , 2 , 3 , 4 , 5 ],
8198 [- 2 , - 2 , 0 , 0 , 7 , 7 ],
99+ [Person (cost = 100.0 ), Person (cost = - 100.0 ), Person (name = "Al" )],
100+ [Dog (weight = 15.5 ), Dog (weight = 15.1 ), Dog (name = "Buddy" )],
82101)
83102
84103
You can’t perform that action at this time.
0 commit comments