Move test macro to where it is used

This commit is contained in:
David Tolnay 2017-01-25 20:55:55 -08:00
parent 7ee175f448
commit 09c69da909
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 14 additions and 15 deletions

View File

@ -1,17 +1,3 @@
#[macro_export]
macro_rules! declare_ser_tests {
($($name:ident { $($value:expr => $tokens:expr,)+ })+) => {
$(
#[test]
fn $name() {
$(
assert_ser_tokens(&$value, $tokens);
)+
}
)+
}
}
macro_rules! btreeset {
() => {
BTreeSet::new()

View File

@ -51,7 +51,20 @@ enum Enum {
//////////////////////////////////////////////////////////////////////////
declare_ser_tests! {
macro_rules! declare_tests {
($($name:ident { $($value:expr => $tokens:expr,)+ })+) => {
$(
#[test]
fn $name() {
$(
assert_ser_tokens(&$value, $tokens);
)+
}
)+
}
}
declare_tests! {
test_unit {
() => &[Token::Unit],
}