comparison test/LazyTensors/lazy_array_test.jl @ 1003:7ef605b8f132 refactor/lazy_tensors

Remove a bunch of todos
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 20 Mar 2022 21:19:00 +0100
parents de2df1214394
children 6104db60b7a3
comparison
equal deleted inserted replaced
1002:271aa6ae1055 1003:7ef605b8f132
57 @test (s *̃ v1)[i] == r_times_s[i] 57 @test (s *̃ v1)[i] == r_times_s[i]
58 @test (s /̃ v1)[i] == 1/r_div_s[i] 58 @test (s /̃ v1)[i] == 1/r_div_s[i]
59 end 59 end
60 @test_throws BoundsError (v1 +̃ v2)[4] 60 @test_throws BoundsError (v1 +̃ v2)[4]
61 v2 = [1., 2, 3, 4] 61 v2 = [1., 2, 3, 4]
62 # Test that size of arrays is asserted when not specified inbounds
63 # TODO: Replace these errors with SizeMismatch
64 @test_throws DimensionMismatch v1 +̃ v2 62 @test_throws DimensionMismatch v1 +̃ v2
65 63
66 # Test operations on LazyArray 64 # Test operations on LazyArray
67 v1 = DummyArray([1, 2.3, 4]) 65 v1 = DummyArray([1, 2.3, 4])
68 v2 = [1., 2, 3] 66 v2 = [1., 2, 3]
74 @test (v1 + v2)[i] == (v2 + v1)[i] == r_add_v[i] 72 @test (v1 + v2)[i] == (v2 + v1)[i] == r_add_v[i]
75 @test (v1 - v2)[i] == -(v2 - v1)[i] == r_sub_v[i] 73 @test (v1 - v2)[i] == -(v2 - v1)[i] == r_sub_v[i]
76 end 74 end
77 @test_throws BoundsError (v1 + v2)[4] 75 @test_throws BoundsError (v1 + v2)[4]
78 v2 = [1., 2, 3, 4] 76 v2 = [1., 2, 3, 4]
79 # Test that size of arrays is asserted when not specified inbounds
80 # TODO: Replace these errors with SizeMismatch
81 @test_throws DimensionMismatch v1 + v2 77 @test_throws DimensionMismatch v1 + v2
82 end 78 end
83 79
84 80
85 @testset "LazyFunctionArray" begin 81 @testset "LazyFunctionArray" begin