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

Function assert_metadata_entry

alpm-package/tests/integration.rs:958–969  ·  view source on GitHub ↗

Small helper function to assert that an entry is a metadata entry and then returns that entry.

(entry: Option<Result<PackageEntry, Error>>)

Source from the content-addressed store, hash-verified

956// Small helper function to assert that an entry is a metadata entry and then returns
957// that entry.
958fn assert_metadata_entry(entry: Option<Result<PackageEntry, Error>>) -> TestResult<MetadataEntry> {
959 assert!(
960 entry.is_some(),
961 "Expected package entry to be of some value."
962 );
963 match entry.unwrap()? {
964 PackageEntry::Metadata(entry) => Ok(*entry),
965 PackageEntry::InstallScriptlet(_) => {
966 panic!("Expected Metadata entry, got install scriptlet.")
967 }
968 }
969}
970
971// Ensure that the package entry iterator short-circuits after finding all known entries.
972#[test]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected