Skip to content

Commit 4a27df9

Browse files
committed
Add simple tests for Core.Compiler.extrema
1 parent 2d70b7d commit 4a27df9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/reduce.jl

+5
Original file line numberDiff line numberDiff line change
@@ -246,24 +246,29 @@ prod2(itr) = invoke(prod, Tuple{Any}, itr)
246246
@test maximum(Int[]; init=-1) == -1
247247
@test minimum(Int[]; init=-1) == -1
248248
@test extrema(Int[]; init=(1, -1)) == (1, -1)
249+
@test Core.Compiler.extrema(Int[]; init=(1, -1)) == (1, -1)
249250

250251
@test maximum(sin, []; init=-1) == -1
251252
@test minimum(sin, []; init=1) == 1
252253
@test extrema(sin, []; init=(1, -1)) == (1, -1)
254+
@test Core.Compiler.extrema(sin, []; init=(1, -1)) == (1, -1)
253255

254256
@test maximum(5) == 5
255257
@test minimum(5) == 5
256258
@test extrema(5) == (5, 5)
257259
@test extrema(abs2, 5) == (25, 25)
260+
@test Core.Compiler.extrema(abs2, 5) == (25, 25)
258261

259262
let x = [4,3,5,2]
260263
@test maximum(x) == 5
261264
@test minimum(x) == 2
262265
@test extrema(x) == (2, 5)
266+
@test Core.Compiler.extrema(x) == (2, 5)
263267

264268
@test maximum(abs2, x) == 25
265269
@test minimum(abs2, x) == 4
266270
@test extrema(abs2, x) == (4, 25)
271+
@test Core.Compiler.extrema(abs2, x) == (4, 25)
267272
end
268273

269274
@test maximum([-0.,0.]) === 0.0

0 commit comments

Comments
 (0)