()
| 456 | assert_eq!(fields[0].value, "alice"); |
| 457 | } |
| 458 | other => panic!("expected MultipartFormData body, got {:?}", other), |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | #[test] |
| 463 | fn parses_basic_auth() { |
| 464 | let parsed = parse_curl("curl -u alice:secret https://api.example.com").unwrap(); |
| 465 | let auth = parsed |
| 466 | .headers |
| 467 | .iter() |
| 468 | .find(|h| h.key.eq_ignore_ascii_case("Authorization")) |
| 469 | .expect("auth header"); |
| 470 | assert!(auth.value.starts_with("Basic ")); |
| 471 | } |
| 472 | |
| 473 | #[test] |
| 474 | fn handles_location_flag() { |
nothing calls this directly
no test coverage detected