//! ref: composer/tests/Composer/Test/Console/HtmlOutputFormatterTest.php use indexmap::IndexMap; use shirabe::console::html_output_formatter::HtmlOutputFormatter; use shirabe_external_packages::symfony::console::formatter::{ OutputFormatterStyle, OutputFormatterStyleInterface, }; #[test] fn test_formatting() { let mut styles: IndexMap> = IndexMap::new(); styles.insert( "warning".to_string(), Box::new(OutputFormatterStyle::new( Some("black"), Some("yellow"), vec![], )), ); let mut formatter = HtmlOutputFormatter::new(styles); assert_eq!( Some( "text green yellow black w/ yellow bg" .to_string() ), formatter .format(Some( "text green yellow black w/ yellow bg" )) .unwrap() ); }