Mercurial > repos > public > sbplib_julia
comparison test/testLazyTensors.jl @ 486:8082d43103c1 feature/compose_identity_mappings
Add TODOs relating to SizeMismatch
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 05 Nov 2020 10:49:49 +0100 |
parents | 4b49f03bdb98 |
children | cd509e57f898 df566372bb4f |
comparison
equal
deleted
inserted
replaced
485:4b49f03bdb98 | 486:8082d43103c1 |
---|---|
175 @test (s /̃ v1)[i] == 1/r_div_s[i] | 175 @test (s /̃ v1)[i] == 1/r_div_s[i] |
176 end | 176 end |
177 @test_throws BoundsError (v1 +̃ v2)[4] | 177 @test_throws BoundsError (v1 +̃ v2)[4] |
178 v2 = [1., 2, 3, 4] | 178 v2 = [1., 2, 3, 4] |
179 # Test that size of arrays is asserted when not specified inbounds | 179 # Test that size of arrays is asserted when not specified inbounds |
180 # TODO: Replace these errors with SizeMismatch | |
180 @test_throws DimensionMismatch v1 +̃ v2 | 181 @test_throws DimensionMismatch v1 +̃ v2 |
181 | 182 |
182 # Test operations on LazyArray | 183 # Test operations on LazyArray |
183 v1 = DummyArray([1, 2.3, 4]) | 184 v1 = DummyArray([1, 2.3, 4]) |
184 v2 = [1., 2, 3] | 185 v2 = [1., 2, 3] |
191 @test (v1 - v2)[i] == -(v2 - v1)[i] == r_sub_v[i] | 192 @test (v1 - v2)[i] == -(v2 - v1)[i] == r_sub_v[i] |
192 end | 193 end |
193 @test_throws BoundsError (v1 + v2)[4] | 194 @test_throws BoundsError (v1 + v2)[4] |
194 v2 = [1., 2, 3, 4] | 195 v2 = [1., 2, 3, 4] |
195 # Test that size of arrays is asserted when not specified inbounds | 196 # Test that size of arrays is asserted when not specified inbounds |
197 # TODO: Replace these errors with SizeMismatch | |
196 @test_throws DimensionMismatch v1 + v2 | 198 @test_throws DimensionMismatch v1 + v2 |
197 end | 199 end |
198 | 200 |
199 | 201 |
200 @testset "LazyFunctionArray" begin | 202 @testset "LazyFunctionArray" begin |