@@ -21,7 +21,11 @@ using GradedArrays:
2121 SectorOneTo,
2222 SectorUnitRange,
2323 SU,
24+ checkspaces,
25+ checkspaces_dual,
2426 dual,
27+ findfirstblock,
28+ findfirstblock_sector,
2529 flip,
2630 gradedrange,
2731 isdual,
@@ -96,6 +100,8 @@ using Test: @test, @test_throws, @testset
96100 @test findblock (g, 2 ) == Block (1 )
97101 @test findblock (g, 3 ) == Block (2 )
98102 @test findblockindex (g, 3 ) == Block (2 )[1 ]
103+ @test findfirstblock_sector (g, " y" ) == Block (2 )
104+ @test isnothing (findfirstblock_sector (g, " a" ))
99105
100106 @test axes (Base. Slice (g)) isa Tuple{typeof (g)}
101107 @test AbstractUnitRange {Int} (g) == 1 : 7
@@ -205,8 +211,15 @@ using Test: @test, @test_throws, @testset
205211 @test space_isequal (only (axes (a)), gradedrange ([" y" => 6 , " x" => 2 ]; isdual= isdual (g)))
206212 end
207213
214+ @test checkspaces (Bool, (g1, g1d), (g1, g1d))
215+
208216 @test space_isequal (g1d, dual (g1))
209217 @test space_isequal (dual (g1d), g1)
218+ @test checkspaces ((g1, g1d), (g1, g1d))
219+ @test checkspaces_dual (Bool, (g1, g1d), (g1d, g1))
220+ @test checkspaces_dual ((g1, g1d), (g1d, g1))
221+ @test_throws ArgumentError checkspaces ((g1, g1), (g1, g1d))
222+ @test_throws ArgumentError checkspaces_dual ((g1, g1), (g1, g1d))
210223
211224 for a in (
212225 combine_blockaxes (g1, b0),
274287 @test g[4 ] == 4
275288 @test g[Block (1 )[1 ]] == 1
276289 @test g[Block (2 )[1 ]] == 3
290+ @test findfirstblock (g, SU ((1 , 0 ))) == Block (2 )
291+ @test isnothing (findfirstblock (g, SU ((2 , 0 ))))
277292
278293 # Non-abelian slicing operations
279294 a = g[2 : 4 ]
0 commit comments