Skip to content

Commit d0464e5

Browse files
mtfishmanclaude
andcommitted
Replace remaining @test_broken with @test ... broken = ...
Convert the rest of the `@test_broken` calls in `test_basics.jl` and `test_map.jl` to the `broken = ...` keyword form, fold the surviving `if arrayt === Array; ...; else; @test_broken ...; end` pair in `test_map.jl` into a single `@test ... broken = arrayt ≢ Array`, and drop the now-unused `@test_broken` import from `test_genericblockindex.jl` and `test_tensoralgebraext.jl`. Also gate the LQ regression broken marker in `test_abstract_blocktype.jl` on `pkgversion(MatrixAlgebraKit) < v"0.6.7"` so the marker auto-disables once the upstream LQ gauge-fixing fix lands in MatrixAlgebraKit 0.6.7 (QuantumKitHub/MatrixAlgebraKit.jl#219). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8152728 commit d0464e5

5 files changed

Lines changed: 23 additions & 24 deletions

File tree

test/test_abstract_blocktype.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ using BlockArrays: Block
33
using BlockSparseArrays: BlockSparseMatrix, blockstoredlength
44
using JLArrays: JLArray
55
using LinearAlgebra: hermitianpart, norm
6-
using MatrixAlgebraKit: eig_full, eig_trunc, eig_vals, eigh_full, eigh_trunc, eigh_vals,
7-
isisometric, left_orth, left_polar, lq_compact, lq_full, qr_compact, qr_full,
8-
right_orth, right_polar, svd_compact, svd_full, svd_trunc
6+
using MatrixAlgebraKit: MatrixAlgebraKit, eig_full, eig_trunc, eig_vals, eigh_full,
7+
eigh_trunc, eigh_vals, isisometric, left_orth, left_polar, lq_compact, lq_full,
8+
qr_compact, qr_full, right_orth, right_polar, svd_compact, svd_full, svd_trunc
99
using SparseArraysBase: storedlength
1010
using StableRNGs: StableRNG
1111
using Test: @test, @testset
@@ -97,9 +97,12 @@ arrayts = (Array, JLArray)
9797
c, u = f(a)
9898
# `right_orth`, `lq_compact`, `lq_full` on JLArray-backed
9999
# `BlockSparseMatrix{T, AbstractMatrix{T}}` produce a `c * u` that does not
100-
# reproduce `a` (regression in MatrixAlgebraKit 0.6.6, tracked at
101-
# https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/issues/218).
102-
@test c * u a broken = (arrayt Array && f (right_orth, lq_compact, lq_full))
100+
# reproduce `a` (regression in MatrixAlgebraKit 0.6.6; fix tracked at
101+
# https://github.com/QuantumKitHub/MatrixAlgebraKit.jl/pull/219).
102+
@test c * u a broken = (
103+
arrayt Array && f (right_orth, lq_compact, lq_full) &&
104+
pkgversion(MatrixAlgebraKit) < v"0.6.7"
105+
)
103106
# TODO: Fix comparison with UniformScaling on GPU.
104107
@test isisometric(u; side = :right) broken = arrayt Array
105108
end

test/test_basics.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using JLArrays: JLArray, JLMatrix
1111
using LinearAlgebra: Adjoint, Transpose, dot, norm, tr
1212
using SparseArraysBase:
1313
SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK, isstored, storedlength
14-
using Test: @inferred, @test, @test_broken, @test_throws, @testset
14+
using Test: @inferred, @test, @test_throws, @testset
1515
using TestExtras: @constinferred
1616
using TypeParameterAccessors: TypeParameterAccessors, Position
1717
include("TestBlockSparseArraysUtils.jl")
@@ -28,18 +28,18 @@ arrayts = (Array, JLArray)
2828
a = dev(BlockSparseArray{elt}(undef, [2, 3], [2, 3]))
2929
a[Block(1, 1)] = dev(randn(elt, 2, 2))
3030
a[Block(2, 2)] = dev(randn(elt, 3, 3))
31-
@test_broken a[:, 4]
31+
@test a[:, 4] broken = true
3232

3333
# TODO: Fix this and turn it into a proper test.
3434
a = dev(BlockSparseArray{elt}(undef, [2, 3], [2, 3]))
3535
a[Block(1, 1)] = dev(randn(elt, 2, 2))
3636
a[Block(2, 2)] = dev(randn(elt, 3, 3))
3737
@allowscalar @test a[2:4, 4] == Array(a)[2:4, 4]
38-
@test_broken a[4, 2:4]
38+
@test a[4, 2:4] broken = true
3939

4040
@test a[Block(1), :] isa BlockSparseArray{elt}
4141
@test adjoint(a) isa Adjoint{elt, <:BlockSparseArray}
42-
@test_broken adjoint(a)[Block(1), :] isa Adjoint{elt, <:BlockSparseArray}
42+
@test adjoint(a)[Block(1), :] isa Adjoint{elt, <:BlockSparseArray} broken = true
4343
# could also be directly a BlockSparseArray
4444
end
4545
@testset "Constructors" begin
@@ -153,10 +153,10 @@ arrayts = (Array, JLArray)
153153
a = arrayt(randn(elt, 2, 2))
154154
@test (@constinferred blockstype(a)) <: BlockArrays.BlockView{elt, 2}
155155
# TODO: This is difficult to determine just from type information.
156-
@test_broken blockstype(typeof(a)) <: BlockArrays.BlockView{elt, 2}
156+
@test blockstype(typeof(a)) <: BlockArrays.BlockView{elt, 2} broken = true
157157
@test (@constinferred blocktype(a)) <: arrayt{elt, 2}
158158
# TODO: This is difficult to determine just from type information.
159-
@test_broken blocktype(typeof(a)) <: SubArray{elt, 2, arrayt{elt, 2}}
159+
@test blocktype(typeof(a)) <: SubArray{elt, 2, arrayt{elt, 2}} broken = true
160160

161161
a = BlockSparseMatrix{elt, arrayt{elt, 2}}(undef, [1, 1], [1, 1])
162162
@test (@constinferred blockstype(a)) <: SparseMatrixDOK{arrayt{elt, 2}}
@@ -173,9 +173,9 @@ arrayts = (Array, JLArray)
173173
a = BlockedArray(arrayt(randn(elt, 2, 2)), [1, 1], [1, 1])
174174
@test (@constinferred blockstype(a)) <: BlockArrays.BlocksView{elt, 2}
175175
# TODO: This is difficult to determine just from type information.
176-
@test_broken blockstype(typeof(a)) <: BlockArrays.BlocksView{elt, 2}
176+
@test blockstype(typeof(a)) <: BlockArrays.BlocksView{elt, 2} broken = true
177177
@test blocktype(a) <: AbstractMatrix{elt}
178-
@test_broken blocktype(typeof(a)) <: AbstractMatrix{elt}
178+
@test blocktype(typeof(a)) <: AbstractMatrix{elt} broken = true
179179

180180
# sparsemortar
181181
for ax in (

test/test_genericblockindex.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using BlockArrays: Block, BlockIndex, BlockSlice, BlockedArray, BlockedVector, b
33
using BlockSparseArrays: BlockSparseArrays, BlockIndexVector, BlockIndices,
44
GenericBlockIndex, blockedunitrange_getindices, blocksparsezeros, to_block,
55
to_block_indices, to_blockindexrange
6-
using Test: @test, @test_broken, @testset
6+
using Test: @test, @testset
77

88
# blockrange
99
# checkindex

test/test_map.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using GPUArraysCore: @allowscalar
77
using JLArrays: JLArray
88
using SparseArraysBase: storedlength
99
using StableRNGs: StableRNG
10-
using Test: @test, @test_broken, @test_throws, @testset
10+
using Test: @test, @test_throws, @testset
1111

1212
elts = (Float32, Float64, ComplexF32)
1313
arrayts = (Array, JLArray)
@@ -407,12 +407,8 @@ arrayts = (Array, JLArray)
407407
a[Block(1, 1)] = dev(randn(elt, 2, 2))
408408
a[Block(2, 2)] = dev(randn(elt, 3, 3))
409409
I = (:, [2, 4])
410-
if arrayt === Array
411-
@test Array(a[I...]) == Array(a)[I...]
412-
else
413-
# TODO: Broken on GPU, fix this.
414-
@test_broken a[I...]
415-
end
410+
# TODO: Broken on GPU, fix this.
411+
@test Array(a[I...]) == Array(a)[I...] broken = arrayt Array
416412

417413
a = BlockSparseArray{elt}(undef, [2, 3], [2, 3])
418414
@views for b in [Block(1, 1), Block(2, 2)]
@@ -718,5 +714,5 @@ arrayts = (Array, JLArray)
718714
a[Block(2, 2)] = randn(elt, 3, 3)
719715
@test a[2:4, 4] == Array(a)[2:4, 4]
720716
# TODO: Fix this.
721-
@test_broken a[4, 2:4] == Array(a)[4, 2:4]
717+
@test a[4, 2:4] == Array(a)[4, 2:4] broken = true
722718
end

test/test_tensoralgebraext.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using BlockArrays: Block, BlockArray, blockedrange, blocksize
22
using BlockSparseArrays: BlockSparseArray
33
using Random: randn!
44
using TensorAlgebra: contract
5-
using Test: @test, @test_broken, @testset
5+
using Test: @test, @testset
66

77
function randn_blockdiagonal(elt::Type, axes::Tuple)
88
a = BlockSparseArray{elt}(undef, axes)

0 commit comments

Comments
 (0)