comparison test/testLazyTensors.jl @ 338:2b0c9b30ea3b refactor/combine_to_one_package

Add test sets for each submodule to make the test output nicer
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 25 Sep 2020 13:48:23 +0200
parents f4e3e71a4ff4
children 7fe43d902a27
comparison
equal deleted inserted replaced
337:d93099b1882e 338:2b0c9b30ea3b
1 using Test 1 using Test
2 using Sbplib.LazyTensors 2 using Sbplib.LazyTensors
3 using Sbplib.RegionIndices 3 using Sbplib.RegionIndices
4
5 @testset "LazyTensors" begin
4 6
5 @testset "Generic Mapping methods" begin 7 @testset "Generic Mapping methods" begin
6 struct DummyMapping{T,R,D} <: TensorMapping{T,R,D} end 8 struct DummyMapping{T,R,D} <: TensorMapping{T,R,D} end
7 LazyTensors.apply(m::DummyMapping{T,R,D}, v, i::NTuple{R,Index{<:Region}}) where {T,R,D} = :apply 9 LazyTensors.apply(m::DummyMapping{T,R,D}, v, i::NTuple{R,Index{<:Region}}) where {T,R,D} = :apply
8 @test range_dim(DummyMapping{Int,2,3}()) == 2 10 @test range_dim(DummyMapping{Int,2,3}()) == 2
187 @test_throws BoundsError (v1 + v2)[4] 189 @test_throws BoundsError (v1 + v2)[4]
188 v2 = [1., 2, 3, 4] 190 v2 = [1., 2, 3, 4]
189 # Test that size of arrays is asserted when not specified inbounds 191 # Test that size of arrays is asserted when not specified inbounds
190 @test_throws DimensionMismatch v1 + v2 192 @test_throws DimensionMismatch v1 + v2
191 end 193 end
194
195 end