@@ -709,51 +709,39 @@ end
709
709
@test extrema (f, x) == extrema (f, y)
710
710
@test extrema (spzeros (n, n)) == (0.0 , 0.0 )
711
711
@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 ))
717
714
@test extrema (sparse (ones (n, n))) == (1.0 , 1.0 )
718
715
@test extrema (sparse (ones (n))) == (1.0 , 1.0 )
719
716
@test extrema (A; dims= :) == extrema (B; dims= :)
720
717
@test extrema (A; dims= 1 ) == extrema (B; dims= 1 )
721
718
@test extrema (A; dims= 2 ) == extrema (B; dims= 2 )
722
719
@test extrema (A; dims= (1 ,2 )) == extrema (B; dims= (1 ,2 ))
723
720
@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 )
728
722
@test extrema (A; dims= []) == extrema (B; dims= [])
729
723
@test extrema (x; dims= :) == extrema (y; dims= :)
730
724
@test extrema (x; dims= 1 ) == extrema (y; dims= 1 )
731
725
@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 )
736
727
@test extrema (x; dims= []) == extrema (y; dims= [])
737
728
end
738
729
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))
747
735
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 ))
757
745
end
758
746
end
759
747
0 commit comments