mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
6ee4118299
coretests: add argument order regression tests for min_by/max_by/minmax_by PR rust-lang/rust#136307 introduced a regression in min_by, max_by, and minmax_by: the compare closure received arguments as (v2, v1) instead of (v1, v2), contrary to the documented contract. Although this was fixed in rust-lang/rust#139357, no regression tests were added. This PR adds regression tests for all three functions, verifying that compare always receives arguments in the documented order (v1, v2). As a bonus: first coretests coverage for minmax_by.