Files
tubestation/third_party/rust/rayon/tests/chars.rs
Max Inden 80d40104c4 Bug 1933199 - update Rust rayon crate to v1.10.0 r=kershaw,supply-chain-reviewers,valentin
[mozilla/neqo#2135](https://github.com/mozilla/neqo/pull/2135) adds `mtu` crate
to `neqo-*`. `mtu` crate depends on `windows-bindgen`. `windows-bindgen` depends
on `rayon` `1.7`.

On the other hand mozilla-central depends on [`rayon`
`v1.6.1`](https://searchfox.org/mozilla-central/rev/7987501f2c2ed1914e5c682bd328ace9c4a7c6cd/Cargo.lock#5149-5157).

Given that mozilla-central allows at most one version of each crate, let's
update mozilla-central to `rayon` `1.10.0`, i.e. the most recent version.

See https://github.com/mozilla/neqo/pull/2135#issuecomment-2497077670 for details.

Differential Revision: https://phabricator.services.mozilla.com/D230127
2024-11-28 14:45:20 +00:00

39 lines
1.0 KiB
Rust

use rayon::prelude::*;
#[test]
fn half_open_correctness() {
let low = char::from_u32(0xD800 - 0x7).unwrap();
let high = char::from_u32(0xE000 + 0x7).unwrap();
let range = low..high;
let mut chars: Vec<char> = range.into_par_iter().collect();
chars.sort();
assert_eq!(
chars,
vec![
'\u{D7F9}', '\u{D7FA}', '\u{D7FB}', '\u{D7FC}', '\u{D7FD}', '\u{D7FE}', '\u{D7FF}',
'\u{E000}', '\u{E001}', '\u{E002}', '\u{E003}', '\u{E004}', '\u{E005}', '\u{E006}',
]
);
}
#[test]
fn closed_correctness() {
let low = char::from_u32(0xD800 - 0x7).unwrap();
let high = char::from_u32(0xE000 + 0x7).unwrap();
let range = low..=high;
let mut chars: Vec<char> = range.into_par_iter().collect();
chars.sort();
assert_eq!(
chars,
vec![
'\u{D7F9}', '\u{D7FA}', '\u{D7FB}', '\u{D7FC}', '\u{D7FD}', '\u{D7FE}', '\u{D7FF}',
'\u{E000}', '\u{E001}', '\u{E002}', '\u{E003}', '\u{E004}', '\u{E005}', '\u{E006}',
'\u{E007}',
]
);
}