| 1 | mod recordsrust-analyzer cargo rust-apt 0.8.0 records/ { |
| 2 | use rust_aptrust-analyzer cargo rust-apt 0.8.0 crate/::new_cacherust-analyzer cargo rust-apt 0.8.0 macros/new_cache!; |
| 3 | use rust_aptrust-analyzer cargo rust-apt 0.8.0 crate/::recordsrust-analyzer cargo rust-apt 0.8.0 records/::RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/; |
| 4 | |
| 5 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 6 | fn fieldsrust-analyzer cargo rust-apt 0.8.0 records/fields().() { |
| 7 | let cache = new_cacherust-analyzer cargo rust-apt 0.8.0 macros/new_cache!!().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 8 | |
| 9 | let cand = cache.getrust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]get().("apt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().candidaterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]candidate().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 10 | |
| 11 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 12 | cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().(RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/::Maintainerrust-analyzer cargo rust-apt 0.8.0 records/RecordField/Maintainer.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), |
| 13 | "APT Development Team <[email protected]>" |
| 14 | ); |
| 15 | // Apt should not have a homepage |
| 16 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().(RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/::Homepagerust-analyzer cargo rust-apt 0.8.0 records/RecordField/Homepage.).is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().()); |
| 17 | |
| 18 | // This should also equal the same as the cand version |
| 19 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 20 | cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().(RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/::Versionrust-analyzer cargo rust-apt 0.8.0 records/RecordField/Version.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), |
| 21 | cand.versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/impl#[VerIterator]version().() |
| 22 | ); |
| 23 | |
| 24 | // We can just print these for good luck. |
| 25 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Depends {:?}", cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().(RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/::Dependsrust-analyzer cargo rust-apt 0.8.0 records/RecordField/Depends.)); |
| 26 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("PreDepends {:?}", cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().(RecordFieldrust-analyzer cargo rust-apt 0.8.0 records/RecordField/::PreDependsrust-analyzer cargo rust-apt 0.8.0 records/RecordField/PreDepends.)); |
| 27 | |
| 28 | // This should be the same as what the Hash accessors will give. |
| 29 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(cand.get_recordrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]get_record().("SHA256"), cand.sha256rust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]sha256().()); |
| 30 | } |
| 31 | } |