MCPcopy Create free account
hub / github.com/PowerShell/DSC / match_with_comma_separated_criteria

Function match_with_comma_separated_criteria

resources/sshdconfig/src/parser.rs:584–597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

582
583 #[test]
584 fn match_with_comma_separated_criteria() {
585 let input = r#"
586match user alice,bob
587 passwordauthentication yes
588"#;
589 let result: Map<String, Value> = parse_text_to_map(input).unwrap();
590 let match_array = result.get("match").unwrap().as_array().unwrap();
591 let match_obj = match_array[0].as_object().unwrap();
592 let criteria = match_obj.get("criteria").unwrap().as_object().unwrap();
593 let user_array = criteria.get("user").unwrap().as_array().unwrap();
594 assert_eq!(user_array.len(), 2);
595 assert_eq!(user_array[0], Value::String("alice".to_string()));
596 assert_eq!(user_array[1], Value::String("bob".to_string()));
597 }
598
599 #[test]
600 fn match_with_multiarg_keyword() {

Callers

nothing calls this directly

Calls 2

parse_text_to_mapFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected