From 72cac8beae1edceef7e4d504b9a5a4dad4dd2b84 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Fri, 1 Dec 2017 13:28:16 +0900 Subject: [PATCH] Add a test for special case macros like format! and assert! --- tests/source/macros.rs | 8 ++++++++ tests/target/macros.rs | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tests/source/macros.rs b/tests/source/macros.rs index c8f76906254..ff24939668c 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -216,3 +216,11 @@ make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [ Reject(6, 7), ]); } + +fn special_case_macros() { + // format! + let s = format!("Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected); + + // assert! + assert!(result, "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", result, input, expected); +} diff --git a/tests/target/macros.rs b/tests/target/macros.rs index 25156ff21fd..8230ae91161 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -270,3 +270,18 @@ fn issue2214() { ] ); } + +fn special_case_macros() { + // format! + let s = format!( + "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", + result, input, expected + ); + + // assert! + assert!( + result, + "Arr! While plunderin' the hold, we got '{}' when given '{}' (we expected '{}')", + result, input, expected + ); +}