Small helper function to assert that an entry is a metadata entry and then returns that entry.
(entry: Option<Result<PackageEntry, Error>>)
| 956 | // Small helper function to assert that an entry is a metadata entry and then returns |
| 957 | // that entry. |
| 958 | fn 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] |
nothing calls this directly
no outgoing calls
no test coverage detected