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

Function match_with_multiarg_keyword

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

Source from the content-addressed store, hash-verified

598
599 #[test]
600 fn match_with_multiarg_keyword() {
601 let input = r#"
602match user testuser
603 passwordauthentication yes
604 allowgroups administrators developers
605"#;
606 let result: Map<String, Value> = parse_text_to_map(input).unwrap();
607 let match_array = result.get("match").unwrap().as_array().unwrap();
608 let match_obj = match_array[0].as_object().unwrap();
609 let allowgroups = match_obj.get("allowgroups").unwrap().as_array().unwrap();
610 assert_eq!(allowgroups.len(), 2);
611 assert_eq!(allowgroups[0], Value::String("administrators".to_string()));
612 assert_eq!(allowgroups[1], Value::String("developers".to_string()));
613 }
614
615 #[test]
616 fn match_with_repeated_multiarg_keyword() {

Callers

nothing calls this directly

Calls 2

parse_text_to_mapFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected