diff LazyTensors/test/runtests.jl @ 331:c8bbb4a83518

Merge
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 25 Sep 2020 09:36:06 +0200
parents 41c3c25e4e3b
children
line wrap: on
line diff
--- a/LazyTensors/test/runtests.jl	Fri Sep 25 09:35:41 2020 +0200
+++ b/LazyTensors/test/runtests.jl	Fri Sep 25 09:36:06 2020 +0200
@@ -115,6 +115,15 @@
 end
 
 @testset "LazyArray" begin
+	@testset "LazyConstantArray" begin
+	    @test LazyTensors.LazyConstantArray(3,(3,2)) isa LazyArray{Int,2}
+
+	    lca = LazyTensors.LazyConstantArray(3.0,(3,2))
+	    @test eltype(lca) == Float64
+	    @test ndims(lca) == 2
+	    @test size(lca) == (3,2)
+	    @test lca[2] == 3.0
+	end
     struct DummyArray{T,D, T1<:AbstractArray{T,D}} <: LazyArray{T,D}
         data::T1
     end