comparison test/Grids/equidistant_grid_test.jl @ 1824:7a2375080287 refactor/grids/iterable_boundary_indices

WIP
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 19 Jun 2024 11:16:42 +0200
parents 3e7438e2a033
children 98ae79eb0709
comparison
equal deleted inserted replaced
1624:888e4092e2ed 1824:7a2375080287
68 @test boundary_grid(g, Upper()) == ZeroDimGrid(1.0) 68 @test boundary_grid(g, Upper()) == ZeroDimGrid(1.0)
69 end 69 end
70 70
71 @testset "boundary_indices" begin 71 @testset "boundary_indices" begin
72 g = EquidistantGrid(0:0.1:1) 72 g = EquidistantGrid(0:0.1:1)
73 @test boundary_indices(g, Lower()) == (1,) 73 @test collect(boundary_indices(g, Lower())) == [(1,)]
74 @test boundary_indices(g, Upper()) == (11,) 74 @test collect(boundary_indices(g, Upper())) == [(11,)]
75
76
77 gf = collect(1:length(g))
78 @test gf[boundary_indices(g, Lower()] == gf[1]
79 @test gf[boundary_indices(g, Upper()] == gf[11]
75 80
76 g = EquidistantGrid(2:0.1:10) 81 g = EquidistantGrid(2:0.1:10)
77 @test boundary_indices(g, Lower()) == (1,) 82 @test collect(boundary_indices(g, Lower())) == [(1,)]
78 @test boundary_indices(g, Upper()) == (81,) 83 @test collect(boundary_indices(g, Upper())) == [(81,)]
79 84
80 end 85 end
81 86
82 @testset "refine" begin 87 @testset "refine" begin
83 g = EquidistantGrid(0:0.1:1) 88 g = EquidistantGrid(0:0.1:1)