()
| 540 | |
| 541 | #[test] |
| 542 | fn single_match_block() { |
| 543 | let input = r#" |
| 544 | port 22 |
| 545 | match user bob |
| 546 | gssapiauthentication yes |
| 547 | allowtcpforwarding yes |
| 548 | "#; |
| 549 | let result: Map<String, Value> = parse_text_to_map(input).unwrap(); |
| 550 | let match_array = result.get("match").unwrap().as_array().unwrap(); |
| 551 | assert_eq!(match_array.len(), 1); |
| 552 | let match_obj = match_array[0].as_object().unwrap(); |
| 553 | let criteria = match_obj.get("criteria").unwrap().as_object().unwrap(); |
| 554 | let user_array = criteria.get("user").unwrap().as_array().unwrap(); |
| 555 | assert_eq!(user_array[0], Value::String("bob".to_string())); |
| 556 | assert_eq!(match_obj.get("gssapiauthentication").unwrap(), &Value::Bool(true)); |
| 557 | assert_eq!(match_obj.get("allowtcpforwarding").unwrap(), &Value::Bool(true)); |
| 558 | } |
| 559 | |
| 560 | #[test] |
| 561 | fn multiple_match_blocks() { |
nothing calls this directly
no test coverage detected