We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6954628 commit 044ec3cCopy full SHA for 044ec3c
stdlib/Random/test/runtests.jl
@@ -1071,14 +1071,12 @@ end
1071
end
1072
1073
@testset "not identity" begin
1074
- function is_not_identity_at_least_once()
1075
- function f(::Any)
1076
- tup = ntuple(identity, 9)
1077
- tup !== shuffle(tup)
1078
- end
1079
- @test any(f, 1:1000000)
+ function shuffle_is_identity()
+ tup = ntuple(identity, 9)
+ tup === shuffle(tup)
1080
1081
- is_not_identity_at_least_once()
+ # shuffling may behave as the identity sometimes, but if it doesn't manage to actually reorder some of the elements at least once, something is wrong
+ @test any((_ -> !shuffle_is_identity()), 1:1000000)
1082
1083
1084
0 commit comments