Skip to content

Commit 1a36b0f

Browse files
committed
librustc: Remove fail_unless!
1 parent 10e6869 commit 1a36b0f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/librustc/middle/astencode.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,17 @@ fn roundtrip(in_item: Option<@ast::item>) {
13361336
let ebml_doc = reader::Doc(@bytes);
13371337
let out_item = decode_item_ast(ebml_doc);
13381338
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);
13401350
}
13411351

13421352
#[test]

src/test/run-pass/auto-encode.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ use std::ebml;
2525
use std::serialize::{Decodable, Encodable};
2626
use std::time;
2727

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!`
2842
fn test_ebml<A:
2943
Eq +
3044
Encodable<EBWriter::Encoder> +

0 commit comments

Comments
 (0)