mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Update test_cat.rs
Refactored to constants
This commit is contained in:
parent
a69cb11de9
commit
9167a4128d
1 changed files with 3 additions and 3 deletions
|
@ -348,12 +348,12 @@ fn test_squeeze_blank_before_numbering() {
|
||||||
fn test_dev_random() {
|
fn test_dev_random() {
|
||||||
let mut buf = [0; 2048];
|
let mut buf = [0; 2048];
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn rand_gen() -> &'static str { "/dev/urandom"}
|
const DEV_RANDOM: &str = "/dev/urandom";
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
fn rand_gen() -> &'static str { "/dev/random"}
|
const DEV_RANDOM: &str = "/dev/random";
|
||||||
|
|
||||||
let mut proc = new_ucmd!().args(&[rand_gen()]).run_no_wait();
|
let mut proc = new_ucmd!().args(&[DEV_RANDOM]).run_no_wait();
|
||||||
let mut proc_stdout = proc.stdout.take().unwrap();
|
let mut proc_stdout = proc.stdout.take().unwrap();
|
||||||
proc_stdout.read_exact(&mut buf).unwrap();
|
proc_stdout.read_exact(&mut buf).unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue