From: Seiichi Uchida Date: Sat, 17 Mar 2018 16:08:10 +0000 (+0900) Subject: Remove unit tests X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=84ea306d32f0b9950346108c51c10d2e763530ae;p=rust.git Remove unit tests --- diff --git a/src/macros.rs b/src/macros.rs index 030988e5195..1b26c61a820 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -957,50 +957,3 @@ fn format_lazy_static(context: &RewriteContext, shape: Shape, ts: &TokenStream) Some(result) } - -#[cfg(test)] -mod test { - use super::*; - use syntax; - use syntax::parse::{parse_stream_from_source_str, ParseSess}; - use syntax::codemap::{FileName, FilePathMapping}; - - fn format_macro_args_str(s: &str) -> String { - let mut result = String::new(); - syntax::with_globals(|| { - let input = parse_stream_from_source_str( - FileName::Custom("stdin".to_owned()), - s.to_owned(), - &ParseSess::new(FilePathMapping::empty()), - None, - ); - let shape = Shape { - width: 100, - indent: Indent::empty(), - offset: 0, - }; - result = format_macro_args(input.into(), shape).unwrap(); - }); - result - } - - #[test] - fn test_format_macro_args() { - assert_eq!(format_macro_args_str(""), "".to_owned()); - assert_eq!(format_macro_args_str("$ x : ident"), "$x: ident".to_owned()); - assert_eq!( - format_macro_args_str("$ m1 : ident , $ m2 : ident , $ x : ident"), - "$m1: ident, $m2: ident, $x: ident".to_owned() - ); - assert_eq!( - format_macro_args_str("$($beginning:ident),*;$middle:ident;$($end:ident),*"), - "$($beginning: ident),*; $middle: ident; $($end: ident),*".to_owned() - ); - assert_eq!( - format_macro_args_str( - "$ name : ident ( $ ( $ dol : tt $ var : ident ) * ) $ ( $ body : tt ) *" - ), - "$name: ident($($dol: tt $var: ident)*) $($body: tt)*".to_owned() - ); - } -}