ok/jj
1
0
Fork 0
forked from mirrors/jj

Simplify UI test stdio

This commit is contained in:
Benjamin Saunders 2022-10-18 17:33:13 -07:00 committed by Yuya Nishihara
parent 9f01456f84
commit 0a3502453d

View file

@ -283,8 +283,6 @@ pub fn relative_path(mut from: &Path, to: &Path) -> PathBuf {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::io::Cursor;
use jujutsu_lib::testutils; use jujutsu_lib::testutils;
use super::*; use super::*;
@ -294,10 +292,8 @@ mod tests {
let temp_dir = testutils::new_temp_dir(); let temp_dir = testutils::new_temp_dir();
let cwd_path = temp_dir.path().join("repo"); let cwd_path = temp_dir.path().join("repo");
let wc_path = cwd_path.clone(); let wc_path = cwd_path.clone();
let mut unused_stdout_buf = vec![]; let unused_stdout = Box::new(Vec::new());
let mut unused_stderr_buf = vec![]; let unused_stderr = Box::new(Vec::new());
let unused_stdout = Box::new(Cursor::new(&mut unused_stdout_buf));
let unused_stderr = Box::new(Cursor::new(&mut unused_stderr_buf));
let ui = Ui::new( let ui = Ui::new(
cwd_path, cwd_path,
unused_stdout, unused_stdout,
@ -336,10 +332,8 @@ mod tests {
let temp_dir = testutils::new_temp_dir(); let temp_dir = testutils::new_temp_dir();
let cwd_path = temp_dir.path().join("dir"); let cwd_path = temp_dir.path().join("dir");
let wc_path = cwd_path.parent().unwrap().to_path_buf(); let wc_path = cwd_path.parent().unwrap().to_path_buf();
let mut unused_stdout_buf = vec![]; let unused_stdout = Box::new(Vec::new());
let mut unused_stderr_buf = vec![]; let unused_stderr = Box::new(Vec::new());
let unused_stdout = Box::new(Cursor::new(&mut unused_stdout_buf));
let unused_stderr = Box::new(Cursor::new(&mut unused_stderr_buf));
let ui = Ui::new( let ui = Ui::new(
cwd_path, cwd_path,
unused_stdout, unused_stdout,
@ -380,10 +374,8 @@ mod tests {
let temp_dir = testutils::new_temp_dir(); let temp_dir = testutils::new_temp_dir();
let cwd_path = temp_dir.path().join("cwd"); let cwd_path = temp_dir.path().join("cwd");
let wc_path = cwd_path.join("repo"); let wc_path = cwd_path.join("repo");
let mut unused_stdout_buf = vec![]; let unused_stdout = Box::new(Vec::new());
let mut unused_stderr_buf = vec![]; let unused_stderr = Box::new(Vec::new());
let unused_stdout = Box::new(Cursor::new(&mut unused_stdout_buf));
let unused_stderr = Box::new(Cursor::new(&mut unused_stderr_buf));
let ui = Ui::new( let ui = Ui::new(
cwd_path, cwd_path,
unused_stdout, unused_stdout,