MCPcopy Create free account
hub / github.com/archlinux/alpm / package_try_from_path_fails

Function package_try_from_path_fails

alpm-package/src/package.rs:1309–1324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1307 /// providing a parent directory.
1308 #[test]
1309 fn package_try_from_path_fails() -> TestResult {
1310 init_logger();
1311
1312 // Fail on trying to use a directory without a file name as a package.
1313 assert!(Package::try_from(PathBuf::from("/").as_path()).is_err());
1314
1315 // Fail on trying to use a file without a parent
1316 assert!(
1317 Package::try_from(
1318 PathBuf::from("/something_very_unlikely_to_ever_exist_in_a_filesystem").as_path()
1319 )
1320 .is_err()
1321 );
1322
1323 Ok(())
1324 }
1325
1326 /// Ensure that the Debug implementation of [`PackageEntryIterator`] and
1327 /// [`MetadataEntryIterator`] works as expected.

Callers

nothing calls this directly

Calls 1

init_loggerFunction · 0.70

Tested by

no test coverage detected