833
833
@test endswith (" abc" , r" C" i )
834
834
@test endswith (" abc" , r" Bc" i )
835
835
end
836
+
837
+ # https://github.com/JuliaLang/julia/pull/35316
838
+ @testset " 2arg" begin
839
+ @testset " findmin(f, domain)" begin
840
+ @test findmin (- , 1 : 10 ) == (- 10 , 10 )
841
+ @test findmin (identity, [1 , 2 , 3 , missing ]) === (missing , missing )
842
+ @test findmin (identity, [1 , NaN , 3 , missing ]) === (missing , missing )
843
+ @test findmin (identity, [1 , missing , NaN , 3 ]) === (missing , missing )
844
+ @test findmin (identity, [1 , NaN , 3 ]) === (NaN , NaN )
845
+ @test findmin (identity, [1 , 3 , NaN ]) === (NaN , NaN )
846
+ @test all (findmin (cos, 0 : π/ 2 : 2 π) .≈ (- 1.0 , π))
847
+ end
848
+
849
+ @testset " findmax(f, domain)" begin
850
+ @test findmax (- , 1 : 10 ) == (- 1 , 1 )
851
+ @test findmax (identity, [1 , 2 , 3 , missing ]) === (missing , missing )
852
+ @test findmax (identity, [1 , NaN , 3 , missing ]) === (missing , missing )
853
+ @test findmax (identity, [1 , missing , NaN , 3 ]) === (missing , missing )
854
+ @test findmax (identity, [1 , NaN , 3 ]) === (NaN , NaN )
855
+ @test findmax (identity, [1 , 3 , NaN ]) === (NaN , NaN )
856
+ @test findmax (cos, 0 : π/ 2 : 2 π) == (1.0 , 0.0 )
857
+ end
858
+
859
+ @testset " argmin(f, domain)" begin
860
+ @test argmin (- , 1 : 10 ) == 10
861
+ @test argmin (sum, Iterators. product (1 : 5 , 1 : 5 )) == (1 , 1 )
862
+ end
863
+
864
+ @testset " argmax(f, domain)" begin
865
+ @test argmax (- , 1 : 10 ) == 1
866
+ @test argmax (sum, Iterators. product (1 : 5 , 1 : 5 )) == (5 , 5 )
867
+ end
868
+ end
0 commit comments