forked from gentoo-utils/gentoo-utils
add repo parser test
This commit is contained in:
1
tests/repo/meson.build
Normal file
1
tests/repo/meson.build
Normal file
@@ -0,0 +1 @@
|
||||
tests += {meson.current_source_dir() / 'repo.rs': []}
|
||||
17
tests/repo/repo.rs
Normal file
17
tests/repo/repo.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::error::Error;
|
||||
|
||||
use gentoo_utils::repo::Repo;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let repo = Repo::new("/var/db/repos/gentoo");
|
||||
|
||||
for result in repo.categories()? {
|
||||
let cat = result?;
|
||||
|
||||
for result in cat.ebuilds()? {
|
||||
let _ = result?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user