Skip to content

Commit 72cac8b

Browse files
committed
Add a test for special case macros like format! and assert!
1 parent 07106d4 commit 72cac8b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/source/macros.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,11 @@ make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [
216216
Reject(6, 7),
217217
]);
218218
}
219+
220+
fn special_case_macros() {
221+
// format!
222+
let s = format!("Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
223+
224+
// assert!
225+
assert!(result, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected);
226+
}

tests/target/macros.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,18 @@ fn issue2214() {
270270
]
271271
);
272272
}
273+
274+
fn special_case_macros() {
275+
// format!
276+
let s = format!(
277+
"Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
278+
result, input, expected
279+
);
280+
281+
// assert!
282+
assert!(
283+
result,
284+
"Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')",
285+
result, input, expected
286+
);
287+
}

0 commit comments

Comments
 (0)