mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:31:14 -03:00
Re-apply test_only_suppress_stderr
Fix some obnoxious output during certain tests.
This commit is contained in:
@@ -2101,7 +2101,7 @@ macro_rules! validate {
|
||||
fn test_eval_recursion_detection() {
|
||||
test_init();
|
||||
// Ensure that we don't crash on infinite self recursion and mutual recursion.
|
||||
let parser = &mut TestParser::new();
|
||||
let parser = &mut TestParser::new().suppressing_stderr();
|
||||
parser.eval(
|
||||
L!("function recursive ; recursive ; end ; recursive; "),
|
||||
&IoChain::new(),
|
||||
@@ -2123,7 +2123,7 @@ fn test_eval_illegal_exit_code() {
|
||||
let TestParser {
|
||||
ref mut parser,
|
||||
ref mut pushed_dirs,
|
||||
} = TestParser::new();
|
||||
} = TestParser::new().suppressing_stderr();
|
||||
macro_rules! validate {
|
||||
($cmd:expr, $result:expr) => {
|
||||
parser.eval($cmd, &IoChain::new());
|
||||
@@ -2149,7 +2149,7 @@ macro_rules! validate {
|
||||
#[serial]
|
||||
fn test_eval_empty_function_name() {
|
||||
test_init();
|
||||
let parser = &mut TestParser::new();
|
||||
let parser = &mut TestParser::new().suppressing_stderr();
|
||||
parser.eval(
|
||||
L!("function '' ; echo fail; exit 42 ; end ; ''"),
|
||||
&IoChain::new(),
|
||||
|
||||
@@ -103,6 +103,12 @@ pub fn new() -> TestParser {
|
||||
pushed_dirs: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
// Mark that we expect noisy errors to be printed and that these should be suppressed.
|
||||
pub fn suppressing_stderr(mut self) -> TestParser {
|
||||
self.parser.test_only_suppress_stderr = true;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ParserExt {
|
||||
|
||||
Reference in New Issue
Block a user