()
| 435 | |
| 436 | #[tokio::test] |
| 437 | async fn json_into_response() { |
| 438 | let response = json!({ "hello": "lambda"}).into_response().await; |
| 439 | match response.body() { |
| 440 | Body::Text(json) => assert_eq!(json, r#"{"hello":"lambda"}"#), |
| 441 | _ => panic!("invalid body"), |
| 442 | } |
| 443 | assert_eq!( |
| 444 | response |
| 445 | .headers() |
| 446 | .get(CONTENT_TYPE) |
| 447 | .map(|h| h.to_str().expect("invalid header")), |
| 448 | Some("application/json") |
| 449 | ) |
| 450 | } |
| 451 | |
| 452 | #[tokio::test] |
| 453 | async fn text_into_response() { |
nothing calls this directly
no test coverage detected