diff test/testLazyTensors.jl @ 386:895ec483d741 feature/lazy_array/isapprox

Implement isapprox between LazyArray and scalars.
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 01 Oct 2020 07:44:39 +0200
parents 241bd2512c20
children
line wrap: on
line diff
--- a/test/testLazyTensors.jl	Wed Sep 30 21:53:52 2020 +0200
+++ b/test/testLazyTensors.jl	Thu Oct 01 07:44:39 2020 +0200
@@ -126,6 +126,15 @@
 	    @test ndims(lca) == 2
 	    @test size(lca) == (3,2)
 	    @test lca[2] == 3.0
+
+        # Test that the ≈ operator works for scalars
+        @test lca ≈ 3
+        @test lca ≈ 2 atol=3
+        @test 3 ≈ lca
+        @test 2 ≈ lca atol=3
+
+        # And for vectors
+        @test lca ≈ lca
 	end
     struct DummyArray{T,D, T1<:AbstractArray{T,D}} <: LazyArray{T,D}
         data::T1