@@ -60,7 +60,7 @@ fn almost_equals(a: &json::Json, b: &json::Json) -> bool {
60
60
( & json:: String ( ref a) , & json:: String ( ref b) ) => a == b,
61
61
( & json:: List ( ref a) , & json:: List ( ref b) )
62
62
=> 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" ) ,
64
64
( & json:: Null , & json:: Null ) => true ,
65
65
_ => false ,
66
66
}
@@ -70,15 +70,15 @@ fn almost_equals(a: &json::Json, b: &json::Json) -> bool {
70
70
fn assert_json_eq ( results : json:: Json , expected : json:: Json , message : String ) {
71
71
if !almost_equals ( & results, & expected) {
72
72
let _ = print_json_diff ( & results, & expected) . unwrap ( ) ;
73
- fail ! ( message)
73
+ panic ! ( message)
74
74
}
75
75
}
76
76
77
77
78
78
fn run_raw_json_tests ( json_data : & str , run : |json:: Json , json:: Json |) {
79
79
let items = match json:: from_str ( json_data) {
80
80
Ok ( json:: List ( items) ) => items,
81
- _ => fail ! ( "Invalid JSON" )
81
+ _ => panic ! ( "Invalid JSON" )
82
82
} ;
83
83
assert ! ( items. len( ) % 2 == 0 ) ;
84
84
let mut input = None ;
@@ -101,7 +101,7 @@ fn run_json_tests<T: ToJson>(json_data: &str, parse: |input: &str| -> T) {
101
101
let result = parse ( input. as_slice ( ) ) . to_json ( ) ;
102
102
assert_json_eq ( result, expected, input) ;
103
103
} ,
104
- _ => fail ! ( "Unexpected JSON" )
104
+ _ => panic ! ( "Unexpected JSON" )
105
105
}
106
106
} ) ;
107
107
}
@@ -169,7 +169,7 @@ fn stylesheet_from_bytes() {
169
169
|input, expected| {
170
170
let map = match input {
171
171
json:: Object ( map) => map,
172
- _ => fail ! ( "Unexpected JSON" )
172
+ _ => panic ! ( "Unexpected JSON" )
173
173
} ;
174
174
175
175
let result = {
@@ -194,7 +194,7 @@ fn stylesheet_from_bytes() {
194
194
Some ( & json:: String ( ref s) ) => Some ( s. as_slice ( ) ) ,
195
195
Some ( & json:: Null ) => None ,
196
196
None => None ,
197
- _ => fail ! ( "Unexpected JSON" ) ,
197
+ _ => panic ! ( "Unexpected JSON" ) ,
198
198
}
199
199
}
200
200
}
0 commit comments