Mercurial > repos > public > sbplib_julia
comparison test/Grids/grid_test.jl @ 1518:0cd6cf62af93 feature/grids/componentview
Merge refactor/component_type
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Thu, 21 Mar 2024 15:51:29 +0100 |
| parents | 7ee7df7d9b61 d50ea06813d5 |
| children | 43aaf710463e |
comparison
equal
deleted
inserted
replaced
| 1517:7ee7df7d9b61 | 1518:0cd6cf62af93 |
|---|---|
| 13 | 13 |
| 14 @test coordinate_size(DummyGrid{Int, 1}()) == 1 | 14 @test coordinate_size(DummyGrid{Int, 1}()) == 1 |
| 15 @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}()) == 3 | 15 @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}()) == 3 |
| 16 | 16 |
| 17 @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}) == 3 | 17 @test coordinate_size(DummyGrid{SVector{3,Float64}, 2}) == 3 |
| 18 end | |
| 18 | 19 |
| 19 @testset "component_type" begin | 20 @testset "component_type" begin |
| 20 @test component_type(DummyGrid{Int,1}()) == Int | 21 @test component_type(DummyGrid{Int,1}()) == Int |
| 21 @test component_type(DummyGrid{Float64,1}()) == Float64 | 22 @test component_type(DummyGrid{Float64,1}()) == Float64 |
| 22 @test component_type(DummyGrid{Rational,1}()) == Rational | 23 @test component_type(DummyGrid{Rational,1}()) == Rational |
| 23 | 24 |
| 24 @test component_type(DummyGrid{SVector{3,Int},2}()) == Int | 25 @test component_type(DummyGrid{SVector{3,Int},2}()) == Int |
| 25 @test component_type(DummyGrid{SVector{2,Float64},3}()) == Float64 | 26 @test component_type(DummyGrid{SVector{2,Float64},3}()) == Float64 |
| 26 @test component_type(DummyGrid{SVector{4,Rational},4}()) == Rational | 27 @test component_type(DummyGrid{SVector{4,Rational},4}()) == Rational |
| 27 | 28 |
| 28 @test component_type(DummyGrid{Float64,1}) == Float64 | 29 @test component_type(DummyGrid{Float64,1}) == Float64 |
| 29 @test component_type(DummyGrid{SVector{2,Float64},3}) == Float64 | 30 @test component_type(DummyGrid{SVector{2,Float64},3}) == Float64 |
| 30 end | 31 |
| 32 @test component_type(fill(@SVector[1,2], 4,2)) == Int | |
| 31 end | 33 end |
| 32 | 34 |
| 33 @testset "eval_on" begin | 35 @testset "eval_on" begin |
| 34 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), x̄->x̄[1]+x̄[2]) isa LazyArray | 36 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), x̄->x̄[1]+x̄[2]) isa LazyArray |
| 35 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), x̄->x̄[1]+x̄[2]) == fill(3.) | 37 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), x̄->x̄[1]+x̄[2]) == fill(3.) |
