librustc: Remove fail_unless!
This commit is contained in:
parent
10e6869a54
commit
1a36b0f17e
2 changed files with 25 additions and 1 deletions
|
|
@ -1336,7 +1336,17 @@ fn roundtrip(in_item: Option<@ast::item>) {
|
|||
let ebml_doc = reader::Doc(@bytes);
|
||||
let out_item = decode_item_ast(ebml_doc);
|
||||
|
||||
assert_eq!(in_item, out_item);
|
||||
let exp_str = do io::with_str_writer |w| {
|
||||
in_item.encode(&prettyprint::Serializer(w))
|
||||
};
|
||||
let out_str = do io::with_str_writer |w| {
|
||||
out_item.encode(&prettyprint::Serializer(w))
|
||||
};
|
||||
|
||||
debug!("expected string: %s", exp_str);
|
||||
debug!("actual string : %s", out_str);
|
||||
|
||||
assert!(exp_str == out_str);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -25,6 +25,20 @@ use std::ebml;
|
|||
use std::serialize::{Decodable, Encodable};
|
||||
use std::time;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
fn test_prettyprint<A:Encodable<prettyprint::Serializer>>(
|
||||
a: &A,
|
||||
expected: &~str
|
||||
) {
|
||||
let s = do io::with_str_writer |w| {
|
||||
a.encode(&prettyprint::Serializer(w))
|
||||
};
|
||||
debug!("s == %?", s);
|
||||
assert!(s == *expected);
|
||||
}
|
||||
|
||||
>>>>>>> librustc: Remove `fail_unless!`
|
||||
fn test_ebml<A:
|
||||
Eq +
|
||||
Encodable<EBWriter::Encoder> +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue