Mercurial > repos > public > sbplib_julia
changeset 1024:5be17f647018 refactor/sbpoperators/inflation
Add some more tests
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 21 Mar 2022 10:04:15 +0100 |
parents | 52f07c77299d |
children | e74c41c4b60e f857057e61e6 05a25a5063bb |
files | test/LazyTensors/lazy_tensor_operations_test.jl |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test/LazyTensors/lazy_tensor_operations_test.jl Mon Mar 21 09:51:07 2022 +0100 +++ b/test/LazyTensors/lazy_tensor_operations_test.jl Mon Mar 21 10:04:15 2022 +0100 @@ -365,9 +365,10 @@ @test range_size(I) == (3,5,6) @test domain_size(I) == (3,5,6) - # TODO: More tests + @test LazyTensors.inflate(ScalingTensor(1., (4,)),(3,4,5,6), 1) == InflatedLazyTensor(IdentityTensor{Float64}(),ScalingTensor(1., (4,)),IdentityTensor(4,5,6)) + @test LazyTensors.inflate(ScalingTensor(2., (1,)),(3,4,5,6), 2) == InflatedLazyTensor(IdentityTensor(3),ScalingTensor(2., (1,)),IdentityTensor(5,6)) + @test LazyTensors.inflate(ScalingTensor(3., (6,)),(3,4,5,6), 4) == InflatedLazyTensor(IdentityTensor(3,4,5),ScalingTensor(3., (6,)),IdentityTensor{Float64}()) - # Check that the dir is inbounds - - # tm = ScalingOperator(2., (4,)) + @test_throws BoundsError LazyTensors.inflate(ScalingTensor(1., (4,)),(3,4,5,6), 0) + @test_throws BoundsError LazyTensors.inflate(ScalingTensor(1., (4,)),(3,4,5,6), 5) end