File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
- {"coverage_score" : 92.5 , "exclude_path" : " " , "crate_features" : " " }
1
+ {"coverage_score" : 93.1 , "exclude_path" : " " , "crate_features" : " " }
Original file line number Diff line number Diff line change @@ -432,6 +432,7 @@ mod tests {
432
432
assert_eq ! ( headers. content_length( ) , 0 ) ;
433
433
assert_eq ! ( headers. chunked( ) , false ) ;
434
434
assert_eq ! ( headers. expect( ) , false ) ;
435
+ assert_eq ! ( headers. accept( ) , MediaType :: PlainText ) ;
435
436
}
436
437
437
438
#[ test]
@@ -726,4 +727,13 @@ mod tests {
726
727
let header = Header :: try_from ( b"Accept" ) . unwrap ( ) ;
727
728
assert_eq ! ( header. raw( ) , b"Accept" ) ;
728
729
}
730
+
731
+ #[ test]
732
+ fn test_set_accept ( ) {
733
+ let mut headers = Headers :: default ( ) ;
734
+ assert_eq ! ( headers. accept( ) , MediaType :: PlainText ) ;
735
+
736
+ headers. set_accept ( MediaType :: ApplicationJson ) ;
737
+ assert_eq ! ( headers. accept( ) , MediaType :: ApplicationJson ) ;
738
+ }
729
739
}
Original file line number Diff line number Diff line change @@ -522,6 +522,14 @@ mod tests {
522
522
) ;
523
523
}
524
524
525
+ #[ test]
526
+ fn test_display_route_error ( ) {
527
+ assert_eq ! (
528
+ format!( "{}" , RouteError :: HandlerExist ( "test" . to_string( ) ) ) ,
529
+ "handler for test already exists"
530
+ ) ;
531
+ }
532
+
525
533
#[ test]
526
534
fn test_method_to_str ( ) {
527
535
let val = Method :: Get ;
Original file line number Diff line number Diff line change @@ -383,4 +383,15 @@ mod tests {
383
383
response. allow_method ( Method :: Put ) ;
384
384
assert_eq ! ( response. allow( ) , vec![ Method :: Get , Method :: Put ] ) ;
385
385
}
386
+
387
+ #[ test]
388
+ fn test_equal ( ) {
389
+ let response = Response :: new ( Version :: Http10 , StatusCode :: MethodNotAllowed ) ;
390
+ let another_response = Response :: new ( Version :: Http10 , StatusCode :: MethodNotAllowed ) ;
391
+ assert_eq ! ( response, another_response) ;
392
+
393
+ let response = Response :: new ( Version :: Http10 , StatusCode :: OK ) ;
394
+ let another_response = Response :: new ( Version :: Http10 , StatusCode :: BadRequest ) ;
395
+ assert_ne ! ( response, another_response) ;
396
+ }
386
397
}
You can’t perform that action at this time.
0 commit comments