Mercurial > repos > public > sbplib_julia
comparison LazyTensors/test/runtests.jl @ 208:992969237359 boundary_conditions
Remove tests that don't work through the package manager
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 25 Jun 2019 11:09:48 +0200 |
parents | f85a0b38f3ff |
children | 2aa33d0eef90 |
comparison
equal
deleted
inserted
replaced
207:f85a0b38f3ff | 208:992969237359 |
---|---|
83 end | 83 end |
84 @test_throws BoundsError (v1 +̃ v2)[4] | 84 @test_throws BoundsError (v1 +̃ v2)[4] |
85 v2 = [1., 2, 3, 4] | 85 v2 = [1., 2, 3, 4] |
86 # Test that size of arrays is asserted when not specified inbounds | 86 # Test that size of arrays is asserted when not specified inbounds |
87 @test_throws DimensionMismatch v1 +̃ v2 | 87 @test_throws DimensionMismatch v1 +̃ v2 |
88 # Test that no error checking is performed when specified inbounds | |
89 res = (v1,v2) -> (@inbounds (v1 +̃ v2)[1] == 2) | |
90 @test res(v1,v2) | |
91 | 88 |
92 # Test operations on LazyArray | 89 # Test operations on LazyArray |
93 v1 = DummyArray([1, 2.3, 4]) | 90 v1 = DummyArray([1, 2.3, 4]) |
94 v2 = [1., 2, 3] | 91 v2 = [1., 2, 3] |
95 @test isa(v1 + v2, LazyArray) | 92 @test isa(v1 + v2, LazyArray) |
102 end | 99 end |
103 @test_throws BoundsError (v1 + v2)[4] | 100 @test_throws BoundsError (v1 + v2)[4] |
104 v2 = [1., 2, 3, 4] | 101 v2 = [1., 2, 3, 4] |
105 # Test that size of arrays is asserted when not specified inbounds | 102 # Test that size of arrays is asserted when not specified inbounds |
106 @test_throws DimensionMismatch v1 + v2 | 103 @test_throws DimensionMismatch v1 + v2 |
107 # Test that no error checking is performed when specified inbounds | |
108 res = (v1,v2) -> (@inbounds (v1 + v2)[1] == 2) | |
109 @test res(v1,v2) | |
110 end | 104 end |