@@ -34,6 +34,13 @@ def test_perms():
3434 some_perm = pure_0a [7 ]
3535 last_perm = pure_0a [- 1 ]
3636
37+ # Testing hashing:
38+ pure_perm_space_dict = {pure_0a : 'a' , pure_0b : 'b' ,
39+ pure_0c : 'c' , pure_0d : 'd' ,}
40+ assert len (pure_perm_space_dict ) == 1 # They're all the same
41+ assert pure_perm_space_dict [pure_0a ] == pure_perm_space_dict [pure_0b ] == \
42+ pure_perm_space_dict [pure_0c ] == pure_perm_space_dict [pure_0d ] == 'd'
43+
3744 assert type (first_perm ) == type (some_perm ) == type (last_perm ) == Perm
3845 assert set (some_perm ) == set (range (4 ))
3946 assert tuple (first_perm ) == (0 , 1 , 2 , 3 )
@@ -89,6 +96,10 @@ def test_perms():
8996 perm = big_perm_space [i ]
9097 perm .number # Just ensuring no exception
9198 assert big_perm_space .index (perm ) == i
99+
100+ repr_of_big_perm_space = repr (PermSpace (tuple (range (100 , 0 , - 1 ))))
101+ assert '...' in repr_of_big_perm_space
102+ assert len (repr_of_big_perm_space ) <= 100
92103
93104def test_fixed_perm_space ():
94105 pure_perm_space = PermSpace (5 )
@@ -179,6 +190,15 @@ def test_dapplied_perm_space():
179190 assert char not in dapplied_perm
180191 for number in range (5 ):
181192 assert number in dapplied_perm
193+
194+ assert not dapplied_perm_space ._just_fixed .is_fixed
195+ assert not dapplied_perm_space ._just_fixed .is_dapplied
196+ assert not dapplied_perm_space ._just_fixed .is_rapplied
197+ assert not dapplied_perm_space ._just_fixed .is_partial
198+ assert not dapplied_perm_space ._just_fixed .is_combination
199+ assert not dapplied_perm_space ._just_fixed .is_degreed
200+
201+ assert repr (dapplied_perm_space ) == "<PermSpace: 'growl' => range(0, 5)>"
182202
183203def test_degreed_perm_space ():
184204 assert PermSpace (3 , degrees = 0 ).length == 1
0 commit comments