1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

split: adapt tests to API changes of rand

This commit is contained in:
Daniel Hofstetter 2025-01-29 15:15:25 +01:00
parent 7cff766bdc
commit 410bb30c64

View file

@ -5,7 +5,7 @@
// spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase ghijkl mnopq rstuv wxyz fivelines twohundredfortyonebytes onehundredlines nbbbb dxen ncccc rlimit NOFILE // spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase ghijkl mnopq rstuv wxyz fivelines twohundredfortyonebytes onehundredlines nbbbb dxen ncccc rlimit NOFILE
use crate::common::util::{AtPath, TestScenario}; use crate::common::util::{AtPath, TestScenario};
use rand::{thread_rng, Rng, SeedableRng}; use rand::{rng, Rng, SeedableRng};
use regex::Regex; use regex::Regex;
#[cfg(any(target_os = "linux", target_os = "android"))] #[cfg(any(target_os = "linux", target_os = "android"))]
use rlimit::Resource; use rlimit::Resource;
@ -18,8 +18,8 @@ use std::{
}; };
fn random_chars(n: usize) -> String { fn random_chars(n: usize) -> String {
thread_rng() rng()
.sample_iter(&rand::distributions::Alphanumeric) .sample_iter(&rand::distr::Alphanumeric)
.map(char::from) .map(char::from)
.take(n) .take(n)
.collect::<String>() .collect::<String>()