Skip to content

Commit

Permalink
Cargo format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sellig6792 committed May 3, 2024
1 parent ac62732 commit ebbbecf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/cformat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ macro_rules! cformat {
}};
}


#[cfg(test)]
mod tests {
use crate::{Color, Coloration};
Expand All @@ -51,14 +50,22 @@ mod tests {
#[test]
fn test_cformat_with_spaces() {
let string = cformat!("Pre Build", "Parsing `main.rs`...", Color::Green);
let right = format!("{} {}", " Pre Build".apply_color(Color::Green), "Parsing `main.rs`...");
let right = format!(
"{} {}",
" Pre Build".apply_color(Color::Green),
"Parsing `main.rs`..."
);
assert_eq!(string, right);
}

#[test]
fn test_cformat_with_carry_return_at_start() {
let string = cformat!("\rPre Build", "Parsing `main.rs`...", Color::Green);
let right = format!("\r{} {}", " Pre Build".apply_color(Color::Green), "Parsing `main.rs`...");
let right = format!(
"\r{} {}",
" Pre Build".apply_color(Color::Green),
"Parsing `main.rs`..."
);
assert_eq!(string, right);
}
}
}

0 comments on commit ebbbecf

Please sign in to comment.