changeset 1511:d50ea06813d5 refactor/component_type

Move and extend tests to reflect that component_type is more general than before
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 21 Mar 2024 07:59:53 +0100
parents 606975cdb1f3
children 7476877c0b0e
files test/Grids/grid_test.jl
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/test/Grids/grid_test.jl	Thu Mar 21 07:59:03 2024 +0100
+++ b/test/Grids/grid_test.jl	Thu Mar 21 07:59:53 2024 +0100
@@ -15,19 +15,21 @@
     @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}()) == 3
 
     @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}) == 3
+end
 
-    @testset "component_type" begin
-        @test component_type(DummyGrid{Int,1}()) == Int
-        @test component_type(DummyGrid{Float64,1}()) == Float64
-        @test component_type(DummyGrid{Rational,1}()) == Rational
+@testset "component_type" begin
+    @test component_type(DummyGrid{Int,1}()) == Int
+    @test component_type(DummyGrid{Float64,1}()) == Float64
+    @test component_type(DummyGrid{Rational,1}()) == Rational
 
-        @test component_type(DummyGrid{SVector{3,Int},2}()) == Int
-        @test component_type(DummyGrid{SVector{2,Float64},3}()) == Float64
-        @test component_type(DummyGrid{SVector{4,Rational},4}()) == Rational
+    @test component_type(DummyGrid{SVector{3,Int},2}()) == Int
+    @test component_type(DummyGrid{SVector{2,Float64},3}()) == Float64
+    @test component_type(DummyGrid{SVector{4,Rational},4}()) == Rational
 
-        @test component_type(DummyGrid{Float64,1}) == Float64
-        @test component_type(DummyGrid{SVector{2,Float64},3}) == Float64
-    end
+    @test component_type(DummyGrid{Float64,1}) == Float64
+    @test component_type(DummyGrid{SVector{2,Float64},3}) == Float64
+
+    @test component_type(fill(@SVector[1,2], 4,2)) == Int
 end
 
 @testset "eval_on" begin