Skip to content

Commit dc762be

Browse files
committed
fix tests
1 parent a11107c commit dc762be

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
200200
b = 2 * a
201201
@test block_nstored(b) == 2
202202
@test Array(b) == 2 * Array(a)
203-
@test_broken a[:, :] isa BlockSparseArray
203+
@test a[:, :] isa BlockSparseArray
204204
for ax in axes(b)
205-
@test ax isa BlockedUnitRange
205+
@test ax isa BlockedOneTo
206206
end
207207

208208
I = [Block(1)[1:1]]
209-
@test_broken a[I, :]
210-
@test_broken a[:, I]
209+
@test a[I, :] isa BlockSparseArray
210+
@test a[:, I] isa BlockSparseArray
211211
@test size(a[I, I]) == (1, 1)
212212
@test !GradedAxes.isdual(axes(a[I, I], 1))
213213
end

NDTensors/src/lib/GradedAxes/src/gradedunitrange.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ end
177177
function gradedunitrange_blockfirsts(a::AbstractGradedUnitRange)
178178
return labelled.(blockfirsts(unlabel_blocks(a)), blocklabels(a))
179179
end
180-
function BlockArrays.blockfirsts(a::AbstractGradedUnitRange)
180+
function BlockArrays.blockfirsts(a::GradedUnitRange)
181181
return gradedunitrange_blockfirsts(a)
182182
end
183183
function BlockArrays.blockfirsts(a::GradedOneTo)

NDTensors/src/lib/GradedAxes/test/test_basics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ end
106106
@test length(ax) == length(a)
107107
@test blocklengths(ax) == blocklengths(a)
108108
@test blocklabels(ax) == blocklabels(a)
109-
@test_broken(blockfirsts(a)) == [2, 3]
109+
@test blockfirsts(a) == [2, 3]
110110

111111
# Regression test for ambiguity error.
112112
x = gradedrange(["x" => 2, "y" => 3])

NDTensors/src/lib/TensorAlgebra/ext/TensorAlgebraGradedAxesExt/test/test_contract.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
using BlockArrays: Block, blocksize
33
using Compat: Returns
44
using NDTensors.BlockSparseArrays: BlockSparseArray
5-
using NDTensors.GradedAxes: gradedrange
5+
using NDTensors.GradedAxes: GradedAxes, gradedrange
66
using NDTensors.Sectors: U1
77
using NDTensors.SparseArrayInterface: densearray
88
using NDTensors.TensorAlgebra: contract
99
using Random: randn!
1010
using Test: @test, @testset
1111

12+
#TODO remove once fuse_labels is defined in Sectors
13+
GradedAxes.fuse_labels(m::U1, n::U1) = U1(m.n + n.n)
14+
1215
function randn_blockdiagonal(elt::Type, axes::Tuple)
1316
a = BlockSparseArray{elt}(axes)
1417
blockdiaglength = minimum(blocksize(a))

0 commit comments

Comments
 (0)