Mercurial > repos > public > sbplib_julia
comparison test/Grids/equidistant_grid_test.jl @ 1282:11b08b242e48 refactor/grids
Make equdistant_grid return an EquidistantGrid for the 1d Case
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Mon, 27 Feb 2023 15:39:13 +0100 |
| parents | 1157f889bf50 |
| children | 4684c7f1c4cb |
comparison
equal
deleted
inserted
replaced
| 1281:1cc45207817e | 1282:11b08b242e48 |
|---|---|
| 83 end | 83 end |
| 84 end | 84 end |
| 85 | 85 |
| 86 | 86 |
| 87 @testset "equidistant_grid" begin | 87 @testset "equidistant_grid" begin |
| 88 @test equidistant_grid(4,0.0,1.0) isa TensorGrid | 88 @test equidistant_grid(4,0.0,1.0) isa EquidistantGrid |
| 89 @test equidistant_grid(4,0.0,8.0) isa TensorGrid | 89 @test equidistant_grid((4,3),(0.0,0.0),(8.0,5.0)) isa TensorGrid |
| 90 | |
| 90 # constuctor | 91 # constuctor |
| 91 @test_throws DomainError equidistant_grid(0,0.0,1.0) | 92 @test_throws DomainError equidistant_grid(0,0.0,1.0) |
| 92 @test_throws DomainError equidistant_grid(1,1.0,1.0) | 93 @test_throws DomainError equidistant_grid(1,1.0,1.0) |
| 93 @test_throws DomainError equidistant_grid(1,1.0,-1.0) | 94 @test_throws DomainError equidistant_grid(1,1.0,-1.0) |
| 94 @test equidistant_grid(4,0.0,1.0) == equidistant_grid((4,),(0.0,),(1.0,)) | 95 |
| 96 @test_throws DomainError equidistant_grid((0,0),(0.0,0.0),(1.0,1.0)) | |
| 97 @test_throws DomainError equidistant_grid((1,1),(1.0,1.0),(1.0,1.0)) | |
| 98 @test_throws DomainError equidistant_grid((1,1),(1.0,1.0),(-1.0,-1.0)) | |
| 95 | 99 |
| 96 @testset "Base" begin | 100 @testset "Base" begin |
| 97 @test eltype(equidistant_grid(4,0.0,1.0)) == Float64 | 101 @test eltype(equidistant_grid(4,0.0,1.0)) == Float64 |
| 98 @test eltype(equidistant_grid((4,3),(0,0),(1,3))) <: AbstractVector{Float64} | 102 @test eltype(equidistant_grid((4,3),(0,0),(1,3))) <: AbstractVector{Float64} |
| 99 @test size(equidistant_grid(4,0.0,1.0)) == (4,) | 103 @test size(equidistant_grid(4,0.0,1.0)) == (4,) |
