20 lines
579 B
Julia
20 lines
579 B
Julia
using Test
|
|
using GeneralUtils
|
|
|
|
@testset "ealierElementsIndex" begin
|
|
@test GeneralUtils.ealierElementsIndex([1,2,3,4,5], 2) == 1:3
|
|
@test GeneralUtils.ealierElementsIndex([1,2,3], 0) == 1:3
|
|
@test GeneralUtils.ealierElementsIndex([1], 1) == 1:0
|
|
@test GeneralUtils.ealierElementsIndex([], 0) == 1:0
|
|
@test GeneralUtils.ealierElementsIndex([1,2,3,4], 4) == 1:0
|
|
@test GeneralUtils.ealierElementsIndex([1,2,3,4], 5) == 1:0
|
|
@test GeneralUtils.ealierElementsIndex(collect(1:10), 3) == 1:7
|
|
@test_throws ErrorException GeneralUtils.ealierElementsIndex([1,2,3], -1)
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|