comparison test/Grids/equidistant_grid_test.jl @ 1398:447833be2ecc bugfix/grids/complete_interface_impl

Add tests for first and last index of equidistant grid
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Aug 2023 08:59:47 +0200
parents 4684c7f1c4cb
children e56277744ebb
comparison
equal deleted inserted replaced
1394:60857d8338cb 1398:447833be2ecc
17 17
18 @test g[begin] == 0.0 18 @test g[begin] == 0.0
19 @test g[end] == 10.0 19 @test g[end] == 10.0
20 20
21 @test all(eachindex(g) .== 1:101) 21 @test all(eachindex(g) .== 1:101)
22
23 @test firstindex(g) == 1
24 @test lastindex(g) == 101
22 end 25 end
23 26
24 @testset "Iterator interface" begin 27 @testset "Iterator interface" begin
25 @test eltype(EquidistantGrid(0:10)) == Int 28 @test eltype(EquidistantGrid(0:10)) == Int
26 @test eltype(EquidistantGrid(0:2:10)) == Int 29 @test eltype(EquidistantGrid(0:2:10)) == Int