|
729 | 729 | @test_throws LoadError @eval @compat publac @bar, foo
|
730 | 730 | end
|
731 | 731 |
|
| 732 | +# https://github.com/JuliaLang/julia/pull/47679 |
| 733 | +@testset "allunique(f, xs)" begin |
| 734 | + @test allunique(sin, 1:3) |
| 735 | + @test !allunique(sin, [1,2,3,1]) |
| 736 | + @test allunique(sin, (1, 2, pi, im)) # eltype Any |
| 737 | + @test allunique(abs2, 1:100) |
| 738 | + @test !allunique(abs, -10:10) |
| 739 | + @test allunique(abs2, Vector{Any}(1:100)) |
| 740 | + # These cases don't call the function at all: |
| 741 | + @test allunique(error, []) |
| 742 | + @test_skip allunique(error, [1]) # depends on updated code in Base to work |
| 743 | +end |
| 744 | +@testset "allequal(f, xs)" begin |
| 745 | + @test allequal(abs2, [3, -3]) |
| 746 | + @test allequal(x -> 1, rand(3)) |
| 747 | + @test !allequal(x -> rand(), [1,1,1]) |
| 748 | + # tuples |
| 749 | + @test allequal(abs2, (3, -3)) |
| 750 | + @test allequal(x -> 1, Tuple(rand(3))) |
| 751 | + @test !allequal(x -> rand(), (1,1,1)) |
| 752 | + # These cases don't call the function at all: |
| 753 | + @test allequal(error, []) |
| 754 | + @test allequal(error, ()) |
| 755 | + @test allequal(error, (x for x in 1:3 if false)) |
| 756 | + @test_skip allequal(error, [1]) # fixed not by new code but by upgrades to old code |
| 757 | + @test allequal(error, (1,)) |
| 758 | +end |
| 759 | + |
732 | 760 | # https://github.com/JuliaLang/julia/pull/45052
|
733 | 761 | @testset "VersionNumber no-op constructor" begin
|
734 | 762 | v = VersionNumber("1.2.3")
|
|
0 commit comments