using Test using GeneralUtils @testset "lastElementsIndex" begin @test GeneralUtils.lastElementsIndex([1,2,3,4,5], 3) == 3:5 @test GeneralUtils.lastElementsIndex([1,2,3], 5) == 1:3 @test GeneralUtils.lastElementsIndex([1], 1) == 1:1 @test GeneralUtils.lastElementsIndex(collect(1:10), 4) == 7:10 @test GeneralUtils.lastElementsIndex(Float64[], 2) == 1:0 @test GeneralUtils.lastElementsIndex([1,2,3], 0) == length([1,2,3])+1:length([1,2,3]) @test GeneralUtils.lastElementsIndex(["a","b","c"], 2) == 2:3 end