File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1336,7 +1336,17 @@ fn roundtrip(in_item: Option<@ast::item>) {
1336
1336
let ebml_doc = reader::Doc(@bytes);
1337
1337
let out_item = decode_item_ast(ebml_doc);
1338
1338
1339
- assert_eq!( in_item, out_item) ;
1339
+ let exp_str = do io::with_str_writer |w| {
1340
+ in_item.encode(&prettyprint::Serializer(w))
1341
+ };
1342
+ let out_str = do io::with_str_writer |w| {
1343
+ out_item.encode(&prettyprint::Serializer(w))
1344
+ };
1345
+
1346
+ debug!(" expected string: %s", exp_str);
1347
+ debug!(" actual string : %s" , out_str) ;
1348
+
1349
+ assert ! ( exp_str == out_str) ;
1340
1350
}
1341
1351
1342
1352
#[ test]
Original file line number Diff line number Diff line change @@ -25,6 +25,20 @@ use std::ebml;
25
25
use std:: serialize:: { Decodable , Encodable } ;
26
26
use std:: time;
27
27
28
+ <<<<<<< HEAD
29
+ =======
30
+ fn test_prettyprint < A : Encodable < prettyprint:: Serializer > > (
31
+ a : & A ,
32
+ expected : & ~str
33
+ ) {
34
+ let s = do io:: with_str_writer |w | {
35
+ a. encode ( & prettyprint:: Serializer ( w ) )
36
+ } ;
37
+ debug ! ( "s == %?" , s) ;
38
+ assert ! ( s == * expected) ;
39
+ }
40
+
41
+ >>>>>>> librustc: Remove `fail_unless!`
28
42
fn test_ebml < A :
29
43
Eq +
30
44
Encodable < EBWriter :: Encoder > +
You can’t perform that action at this time.
0 commit comments