@@ -199,17 +199,9 @@ impl Formatter for EngFormatter {
199199mod tests {
200200 use super :: * ;
201201
202- macro_rules! fmt {
203- ( $name: ident, $( $key: ident : $value: tt) ,* ) => {
204- new_formatter( stringify!( $name) , & [
205- $( Arg { key: stringify!( $key) , val: stringify!( $value) } ) ,*
206- ] ) . unwrap( )
207- } ;
208- }
209-
210202 #[ test]
211203 fn eng_rounding_and_negatives ( ) {
212- let fmt = fmt ! ( eng, w: 3 ) ;
204+ let fmt = new_fmt ! ( eng, w: 3 ) . unwrap ( ) ;
213205 let config = SharedConfig :: default ( ) ;
214206
215207 let result = fmt
@@ -278,7 +270,7 @@ mod tests {
278270 . unwrap ( ) ;
279271 assert_eq ! ( result, " 10" ) ;
280272
281- let fmt = fmt ! ( eng, w: 5 , p: 1 ) ;
273+ let fmt = new_fmt ! ( eng, w: 5 , p: 1 ) . unwrap ( ) ;
282274 let result = fmt
283275 . format (
284276 & Value :: Number {
@@ -300,19 +292,19 @@ mod tests {
300292 unit : Unit :: Bytes ,
301293 } ;
302294
303- let fmt = fmt ! ( eng, w: 5 , p: Mi ) ;
295+ let fmt = new_fmt ! ( eng, w: 5 , p: Mi ) . unwrap ( ) ;
304296 let result = fmt. format ( & val, & config) . unwrap ( ) ;
305297 assert_eq ! ( result, "14.96GiB" ) ;
306298
307- let fmt = fmt ! ( eng, w: 4 , p: Mi ) ;
299+ let fmt = new_fmt ! ( eng, w: 4 , p: Mi ) . unwrap ( ) ;
308300 let result = fmt. format ( & val, & config) . unwrap ( ) ;
309301 assert_eq ! ( result, "15.0GiB" ) ;
310302
311- let fmt = fmt ! ( eng, w: 3 , p: Mi ) ;
303+ let fmt = new_fmt ! ( eng, w: 3 , p: Mi ) . unwrap ( ) ;
312304 let result = fmt. format ( & val, & config) . unwrap ( ) ;
313305 assert_eq ! ( result, " 15GiB" ) ;
314306
315- let fmt = fmt ! ( eng, w: 2 , p: Mi ) ;
307+ let fmt = new_fmt ! ( eng, w: 2 , p: Mi ) . unwrap ( ) ;
316308 let result = fmt. format ( & val, & config) . unwrap ( ) ;
317309 assert_eq ! ( result, "15GiB" ) ;
318310 }
0 commit comments