File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 11name = " ParallelUtilities"
22uuid = " fad6cfc8-4f83-11e9-06cc-151124046ad0"
33authors = [" Jishnu Bhattacharya <jishnuonline@gmail.com>" ]
4- version = " 0.2.2 "
4+ version = " 0.2.3 "
55
66[deps ]
77Distributed = " 8ba89e20-285c-5b6f-9357-94700520ee1b"
Original file line number Diff line number Diff line change 128128@inline _last (:: Tuple{} ) = ()
129129
130130@inline Base. length (ps:: ProductSplit ) = ps. lastind - ps. firstind + 1
131+
132+ @inline Base. firstindex (ps:: ProductSplit ) = 1
131133@inline Base. lastindex (ps:: ProductSplit ) = ps. lastind - ps. firstind + 1
132134
133135@inline function childindex (ps:: ProductSplit ,ind:: Int )
Original file line number Diff line number Diff line change 8282 @testset " first and last ind" begin
8383 iters = (1 : 10 ,)
8484 ps = ProductSplit (iters,2 ,1 )
85+ @test firstindex (ps) == 1
8586 @test ps. firstind == 1
8687 @test ps. lastind == div (length (iters[1 ]),2 )
88+ @test lastindex (ps) == div (length (iters[1 ]),2 )
89+ @test lastindex (ps) == length (ps)
8790 ps = ProductSplit (iters,2 ,2 )
8891 @test ps. firstind == div (length (iters[1 ]),2 ) + 1
92+ @test firstindex (ps) == 1
8993 @test ps. lastind == length (iters[1 ])
94+ @test lastindex (ps) == length (ps)
9095
9196 for np in length (iters[1 ])+ 1 : length (iters[1 ])+ 10 ,
9297 p in length (iters[1 ])+ 1 : np
317322 for i in 1 : length (ps)
318323 @test ps[i] == ps_col[i]
319324 end
325+ @test ps[end ] == ps[length (ps)]
320326 @test_throws ParallelUtilities. BoundsErrorPS ps[0 ]
321327 @test_throws ParallelUtilities. BoundsErrorPS ps[length (ps)+ 1 ]
322328 end
You can’t perform that action at this time.
0 commit comments