mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #7924 from cakebaker/split_reduce_duplication_in_test
split: use delegation to avoid code duplication in test
This commit is contained in:
commit
8866ec3927
1 changed files with 2 additions and 8 deletions
|
@ -17,9 +17,7 @@ use std::{
|
|||
};
|
||||
use uutests::util::{AtPath, TestScenario};
|
||||
|
||||
use uutests::at_and_ucmd;
|
||||
use uutests::new_ucmd;
|
||||
use uutests::util_name;
|
||||
use uutests::{at_and_ucmd, new_ucmd, util_name};
|
||||
|
||||
fn random_chars(n: usize) -> String {
|
||||
rng()
|
||||
|
@ -114,11 +112,7 @@ impl RandomFile {
|
|||
|
||||
/// Add n lines each of size `RandomFile::LINESIZE`
|
||||
fn add_lines(&mut self, lines: usize) {
|
||||
let mut n = lines;
|
||||
while n > 0 {
|
||||
writeln!(self.inner, "{}", random_chars(Self::LINESIZE)).unwrap();
|
||||
n -= 1;
|
||||
}
|
||||
self.add_lines_with_line_size(lines, Self::LINESIZE);
|
||||
}
|
||||
|
||||
/// Add n lines each of the given size.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue