MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_sysgroups_parse

Function test_sysgroups_parse

crates/sysusers/src/lib.rs:592–613  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

590
591 #[test]
592 fn test_sysgroups_parse() -> Result<()> {
593 let mut entries = SYSGROUPS_REF
594 .lines()
595 .filter(|line| !(line.is_empty() || line.starts_with('#')))
596 .map(|line| SysusersEntry::parse(line).unwrap().unwrap());
597 assert_eq!(
598 entries.next().unwrap(),
599 SysusersEntry::Group {
600 name: "root".into(),
601 id: Some(0.into()),
602 }
603 );
604 assert_eq!(
605 entries.next().unwrap(),
606 SysusersEntry::Group {
607 name: "bin".into(),
608 id: Some(1.into()),
609 }
610 );
611 assert_eq!(entries.count(), 28);
612 Ok(())
613 }
614
615 fn newroot() -> Result<cap_std_ext::cap_tempfile::TempDir> {
616 let root = cap_std_ext::cap_tempfile::tempdir(cap_std::ambient_authority())?;

Callers

nothing calls this directly

Calls 2

parseFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected