We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7c867 commit cd773ecCopy full SHA for cd773ec
tests/tests.rs
@@ -39,6 +39,17 @@ macro_rules! c_fmt {
39
}};
40
}
41
42
+/// Assert that `rust_fmt` produces the same output as C's `asprintf`,
43
+/// and that both match the `expected` literal.
44
+///
45
+/// This takes a format literal, followed by optional printf arguments,
46
+/// followed by `=>` and then the `expected` output.
47
48
+/// Example usage:
49
50
+/// ```
51
+/// assert_eq_fmt!(c"%d %d", 1, 2 => "1 2");
52
53
macro_rules! assert_eq_fmt {
54
($format:literal $(, $p:expr)* => $expected:literal) => {
55
let (bytes_written, s) = c_fmt!($format $(, $p)*);
0 commit comments