diff test/Grids/tensor_grid_test.jl @ 1441:c0c5e0620b83 bugfix/grids/tensor_grid_length

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 22 Nov 2023 17:51:37 +0100
parents 949fe47d65a4 66ad232e45a1
children 0322c181a1cd 88e738d807cb
line wrap: on
line diff
--- a/test/Grids/tensor_grid_test.jl	Thu Sep 07 16:31:29 2023 +0200
+++ b/test/Grids/tensor_grid_test.jl	Wed Nov 22 17:51:37 2023 +0100
@@ -85,12 +85,24 @@
         @test eltype(TensorGrid(g₁, g₄)) == SVector{3,Float64}
         @test eltype(TensorGrid(g₁, g₄, g₂)) == SVector{4,Float64}
 
+        @test eltype(typeof(TensorGrid(g₁, g₂))) == SVector{2,Float64}
+        @test eltype(typeof(TensorGrid(g₁, g₃))) == SVector{2,Float64}
+        @test eltype(typeof(TensorGrid(g₁, g₂, g₃))) == SVector{3,Float64}
+        @test eltype(typeof(TensorGrid(g₁, g₄))) == SVector{3,Float64}
+        @test eltype(typeof(TensorGrid(g₁, g₄, g₂))) == SVector{4,Float64}
+
         @test size(TensorGrid(g₁, g₂)) == (11,6)
         @test size(TensorGrid(g₁, g₃)) == (11,10)
         @test size(TensorGrid(g₁, g₂, g₃)) == (11,6,10)
         @test size(TensorGrid(g₁, g₄)) == (11,)
         @test size(TensorGrid(g₁, g₄, g₂)) == (11,6)
 
+        @test size(TensorGrid(g₁, g₂, g₃),1) == 11
+        @test size(TensorGrid(g₁, g₂, g₃),2) == 6
+        @test size(TensorGrid(g₁, g₂, g₃),3) == 10
+        @test size(TensorGrid(g₁, g₄, g₂),1) == 11
+        @test size(TensorGrid(g₁, g₄, g₂),2) == 6
+
         @test length(TensorGrid(g₁, g₂)) == 66
         @test length(TensorGrid(g₁, g₃)) == 110
         @test length(TensorGrid(g₁, g₂, g₃)) == 660