@@ -709,51 +709,39 @@ end
709709 @test extrema (f, x) == extrema (f, y)
710710 @test extrema (spzeros (n, n)) == (0.0 , 0.0 )
711711 @test extrema (spzeros (n)) == (0.0 , 0.0 )
712- # TODO : Remove the temporary skip once https://github.com/JuliaLang/julia/pull/43604 is merged
713- if isdefined (Base, :_extrema_rf )
714- @test_throws " reducing over an empty" extrema (spzeros (0 , 0 ))
715- @test_throws " reducing over an empty" extrema (spzeros (0 ))
716- end
712+ @test_throws " reducing over an empty" extrema (spzeros (0 , 0 ))
713+ @test_throws " reducing over an empty" extrema (spzeros (0 ))
717714 @test extrema (sparse (ones (n, n))) == (1.0 , 1.0 )
718715 @test extrema (sparse (ones (n))) == (1.0 , 1.0 )
719716 @test extrema (A; dims= :) == extrema (B; dims= :)
720717 @test extrema (A; dims= 1 ) == extrema (B; dims= 1 )
721718 @test extrema (A; dims= 2 ) == extrema (B; dims= 2 )
722719 @test extrema (A; dims= (1 ,2 )) == extrema (B; dims= (1 ,2 ))
723720 @test extrema (f, A; dims= 1 ) == extrema (f, B; dims= 1 )
724- # TODO : Remove the temporary skip once https://github.com/JuliaLang/julia/pull/43604 is merged
725- if isdefined (Base, :_extrema_rf )
726- @test_throws " reducing over an empty" extrema (sparse (C); dims= 1 ) == extrema (C; dims= 1 )
727- end
721+ @test_throws " reducing over an empty" extrema (sparse (C); dims= 1 ) == extrema (C; dims= 1 )
728722 @test extrema (A; dims= []) == extrema (B; dims= [])
729723 @test extrema (x; dims= :) == extrema (y; dims= :)
730724 @test extrema (x; dims= 1 ) == extrema (y; dims= 1 )
731725 @test extrema (f, x; dims= 1 ) == extrema (f, y; dims= 1 )
732- # TODO : Remove the temporary skip once https://github.com/JuliaLang/julia/pull/43604 is merged
733- if isdefined (Base, :_extrema_rf )
734- @test_throws " reducing over an empty" extrema (sparse (z); dims= 1 )
735- end
726+ @test_throws " reducing over an empty" extrema (sparse (z); dims= 1 )
736727 @test extrema (x; dims= []) == extrema (y; dims= [])
737728end
738729
739- # TODO : Remove the temporary skip once https://github.com/JuliaLang/julia/pull/43604 is merged
740- if isdefined (Base, :_extrema_rf )
741- function test_extrema (a; dims_test = ((), 1 , 2 , (1 ,2 ), 3 ))
742- for dims in dims_test
743- vext = extrema (a; dims)
744- vmin, vmax = minimum (a; dims), maximum (a; dims)
745- @test all (x -> isequal (x[1 ], x[2 : 3 ]), zip (vext,vmin,vmax))
746- end
730+ function test_extrema (a; dims_test = ((), 1 , 2 , (1 ,2 ), 3 ))
731+ for dims in dims_test
732+ vext = extrema (a; dims)
733+ vmin, vmax = minimum (a; dims), maximum (a; dims)
734+ @test all (x -> isequal (x[1 ], x[2 : 3 ]), zip (vext,vmin,vmax))
747735 end
748- @testset " NaN test for sparse extrema " begin
749- for sz = ( 3 , 10 , 100 )
750- A = sprand (sz, sz, 0.3 )
751- A[ rand ( 1 : sz ^ 2 ,sz)] . = NaN
752- test_extrema (A)
753- A = sprand (sz * sz, 0.3 )
754- A[ rand ( 1 : sz ^ 2 ,sz)] . = NaN
755- test_extrema (A; dims_test = ((), 1 , 2 ))
756- end
736+ end
737+ @testset " NaN test for sparse extrema " begin
738+ for sz = ( 3 , 10 , 100 )
739+ A = sprand (sz, sz, 0.3 )
740+ A[ rand ( 1 : sz ^ 2 ,sz)] . = NaN
741+ test_extrema (A )
742+ A = sprand (sz * sz, 0.3 )
743+ A[ rand ( 1 : sz ^ 2 ,sz)] . = NaN
744+ test_extrema (A; dims_test = ((), 1 , 2 ))
757745 end
758746end
759747
0 commit comments