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

Function subsystem_roundtrip

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

Source from the content-addressed store, hash-verified

753
754 #[test]
755 fn subsystem_roundtrip() {
756 use crate::formatter::write_config_map_to_text;
757
758 let input = r#"subsystem sftp /usr/bin/sftp
759subsystem pwsh c:/progra~1/powershell/7/pwsh.exe -sshs -NoLogo
760"#;
761 let parsed = parse_text_to_map(input).unwrap();
762 let formatted = write_config_map_to_text(&parsed).unwrap();
763
764 // Parse again to verify round-trip
765 let reparsed = parse_text_to_map(&formatted).unwrap();
766
767 let subsystems1 = parsed.get("subsystem").unwrap().as_array().unwrap();
768 let subsystems2 = reparsed.get("subsystem").unwrap().as_array().unwrap();
769
770 assert_eq!(subsystems1.len(), subsystems2.len());
771 assert_eq!(subsystems1[0], subsystems2[0]);
772 assert_eq!(subsystems1[1], subsystems2[1]);
773 }
774}
775

Callers

nothing calls this directly

Calls 3

parse_text_to_mapFunction · 0.85
write_config_map_to_textFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected