Skip to content

Commit 032e7ae

Browse files
committed
Merge pull request servo#63 from Jurily/master
fail => panic
2 parents 5756806 + 964dd6b commit 032e7ae

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn almost_equals(a: &json::Json, b: &json::Json) -> bool {
6060
(&json::String(ref a), &json::String(ref b)) => a == b,
6161
(&json::List(ref a), &json::List(ref b))
6262
=> a.iter().zip(b.iter()).all(|(ref a, ref b)| almost_equals(*a, *b)),
63-
(&json::Object(_), &json::Object(_)) => fail!("Not implemented"),
63+
(&json::Object(_), &json::Object(_)) => panic!("Not implemented"),
6464
(&json::Null, &json::Null) => true,
6565
_ => false,
6666
}
@@ -70,15 +70,15 @@ fn almost_equals(a: &json::Json, b: &json::Json) -> bool {
7070
fn assert_json_eq(results: json::Json, expected: json::Json, message: String) {
7171
if !almost_equals(&results, &expected) {
7272
let _ = print_json_diff(&results, &expected).unwrap();
73-
fail!(message)
73+
panic!(message)
7474
}
7575
}
7676

7777

7878
fn run_raw_json_tests(json_data: &str, run: |json::Json, json::Json|) {
7979
let items = match json::from_str(json_data) {
8080
Ok(json::List(items)) => items,
81-
_ => fail!("Invalid JSON")
81+
_ => panic!("Invalid JSON")
8282
};
8383
assert!(items.len() % 2 == 0);
8484
let mut input = None;
@@ -101,7 +101,7 @@ fn run_json_tests<T: ToJson>(json_data: &str, parse: |input: &str| -> T) {
101101
let result = parse(input.as_slice()).to_json();
102102
assert_json_eq(result, expected, input);
103103
},
104-
_ => fail!("Unexpected JSON")
104+
_ => panic!("Unexpected JSON")
105105
}
106106
});
107107
}
@@ -169,7 +169,7 @@ fn stylesheet_from_bytes() {
169169
|input, expected| {
170170
let map = match input {
171171
json::Object(map) => map,
172-
_ => fail!("Unexpected JSON")
172+
_ => panic!("Unexpected JSON")
173173
};
174174

175175
let result = {
@@ -194,7 +194,7 @@ fn stylesheet_from_bytes() {
194194
Some(&json::String(ref s)) => Some(s.as_slice()),
195195
Some(&json::Null) => None,
196196
None => None,
197-
_ => fail!("Unexpected JSON"),
197+
_ => panic!("Unexpected JSON"),
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)