Compare commits

...

1 Commits

Author SHA1 Message Date
Ryan Walters
feae1ee191 test: add asset tests, file exists & has min size 2025-09-06 12:15:04 -05:00

25
tests/asset.rs Normal file
View File

@@ -0,0 +1,25 @@
use pacman::asset::Asset;
use speculoos::prelude::*;
use strum::IntoEnumIterator;
#[test]
fn all_asset_paths_exist() {
for asset in Asset::iter() {
let path = asset.path();
let full_path = format!("assets/game/{}", path);
let metadata = std::fs::metadata(&full_path)
.map_err(|e| format!("Error getting metadata for {}: {}", full_path, e))
.unwrap();
assert_that(&metadata.is_file()).is_true();
assert_that(&metadata.len()).is_greater_than(1024);
}
}
#[test]
fn asset_paths_are_non_empty() {
for asset in Asset::iter() {
let path = asset.path();
assert!(!path.is_empty(), "Asset path for {:?} should not be empty", asset);
}
}