use crate::output::format::FormatOutput;
use crate::output::msg::OutputMsg;
use crate::output::output::OutputType;
use super::output::Output;
pub struct TestOutput {
formatter: FormatOutput,
}
impl TestOutput {
pub fn new(formatter: FormatOutput) -> Self {
Self { formatter }
}
}
impl Output for TestOutput {
fn output_type(&self) -> OutputType {
OutputType::Test
}
fn error(&self, msg: &OutputMsg) {
eprintln!("{}", self.formatter.format(msg));
}
fn success(&self, msg: &OutputMsg) {
println!("{}", self.formatter.format(msg));
}
fn plain(&self, _msg: &OutputMsg) {}
fn warning(&self, _msg: &OutputMsg) {}
fn info(&self, _msg: &OutputMsg) {}
fn debug(&self, _msg: &OutputMsg) {}
fn trace(&self, _msg: &OutputMsg) {}
fn progress(&self, _msg: &OutputMsg) {}
}