changeset 1400:a7afba63adb5 bugfix/grids/complete_interface_impl

Add tests for `begin` and `end` indexing for `TensorGrid`s
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Aug 2023 09:05:53 +0200
parents adbdbf1c3480
children c7c5bc2a1ce2
files test/Grids/tensor_grid_test.jl
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/Grids/tensor_grid_test.jl	Tue Aug 22 09:00:34 2023 +0200
+++ b/test/Grids/tensor_grid_test.jl	Tue Aug 22 09:05:53 2023 +0200
@@ -34,6 +34,11 @@
 
             @test TensorGrid(g₁, g₄, g₂)[3,2] isa SVector{4,Float64}
             @test TensorGrid(g₁, g₄, g₂)[3,2] == [0.2, 1., 2., 2.2]
+
+            g = TensorGrid(g₁, g₂)
+            @test g[begin, begin] == g[1,1]
+            @test g[begin, end] == g[1,6]
+            @test g[end, end] == g[11,6]
         end
 
         @testset "cartesian indexing" begin