From 5111bb2903c830a43732ebade53e672778165e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Mon, 4 Nov 2024 18:04:13 -0500 Subject: [PATCH] use isdual ins tests --- .../ext/BlockSparseArraysGradedAxesExt/test/runtests.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl b/NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl index 28cfab0693..e6b9955a77 100644 --- a/NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl +++ b/NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl @@ -140,17 +140,16 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) @test a[I] == a_dense[I] end @test axes(a') == dual.(reverse(axes(a))) - # TODO: Define and use `isdual` here. - @test typeof(axes(a', 1)) === typeof(dual(axes(a, 2))) - @test typeof(axes(a', 2)) === typeof(dual(axes(a, 1))) + + @test isdual(axes(a', 1)) ⊻ isdual(axes(a, 2)) + @test isdual(axes(a', 2)) ⊻ isdual(axes(a, 1)) @test isnothing(show(devnull, MIME("text/plain"), a)) # Check preserving dual in tensor algebra. for b in (a + a, 2 * a, 3 * a - a) @test Array(b) ≈ 2 * Array(a) - # TODO: Define and use `isdual` here. for dim in 1:ndims(a) - @test typeof(axes(b, dim)) === typeof(axes(b, dim)) + @test isdual(axes(b, dim)) == isdual(axes(a, dim)) end end