rust-clippy/tests/ui-toml/print_macro/print_macro.rs
Trevor Arjeski ddcfff6d9a Add allow-print-in-tests config
Add a config, allow-print-in-tests, that can be set in clippy.toml which
allows the usage of `[e]print[ln]!` macros in tests.

Closes #9795
2022-11-04 20:33:04 +03:00

20 lines
287 B
Rust

// compile-flags: --test
#![warn(clippy::print_stdout)]
#![warn(clippy::print_stderr)]
fn foo(n: u32) {
print!("{n}");
eprint!("{n}");
}
#[test]
pub fn foo1() {
print!("{}", 1);
eprint!("{}", 1);
}
#[cfg(test)]
fn foo3() {
print!("{}", 1);
eprint!("{}", 1);
}