summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-11-28 17:22:16 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-11-28 17:22:16 +0000
commit327d871c1627d593b13e35ad7ad6b8ab6efb7f4e (patch)
tree321f1a7a771e46d0b173ce0493fc47a1a60f08f5 /tests
parent7b600344251e79b1554b78ed8a972cac2aea4f3f (diff)
downloadgentoo-utils-327d871c1627d593b13e35ad7ad6b8ab6efb7f4e.tar.gz
add repo parser test
Diffstat (limited to 'tests')
-rw-r--r--tests/meson.build1
-rw-r--r--tests/repo/meson.build1
-rw-r--r--tests/repo/repo.rs17
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
index e99c9c7..27fdce9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,6 +1,7 @@
tests = {}
subdir('porthole')
+subdir('repo')
foreach test, test_args : tests
name = fs.name(test)
diff --git a/tests/repo/meson.build b/tests/repo/meson.build
new file mode 100644
index 0000000..00da4e8
--- /dev/null
+++ b/tests/repo/meson.build
@@ -0,0 +1 @@
+tests += {meson.current_source_dir() / 'repo.rs': []}
diff --git a/tests/repo/repo.rs b/tests/repo/repo.rs
new file mode 100644
index 0000000..20b6980
--- /dev/null
+++ b/tests/repo/repo.rs
@@ -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(())
+}