mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-15 15:55:06 +01:00
debug fmt
This commit is contained in:
parent
86441cf10b
commit
1152f8ab99
2 changed files with 58 additions and 15 deletions
19
src/lib.rs
19
src/lib.rs
|
|
@ -1,3 +1,7 @@
|
|||
// for the test macro expansion
|
||||
#[cfg(test)]
|
||||
extern crate self as mono_fmt;
|
||||
|
||||
pub use mono_fmt_macro::format_args;
|
||||
use std::fmt::{Error, Write};
|
||||
|
||||
|
|
@ -136,8 +140,6 @@ macro_rules! format {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
// for the macros
|
||||
use crate as mono_fmt;
|
||||
|
||||
use crate::format;
|
||||
|
||||
|
|
@ -152,4 +154,17 @@ mod tests {
|
|||
let result = format!("{}", "uwu");
|
||||
assert_eq!(result, "uwu");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_with_strings() {
|
||||
let result = format!("oow{} omg", "uwu");
|
||||
assert_eq!(result, "oowuwu omg");
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn debug() {
|
||||
let result = format!("test {:?} hello", "uwu");
|
||||
assert_eq!(result, r#"test "uwu" hello"#);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue