mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-08 00:07:46 -06:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
feae1ee191 |
25
tests/asset.rs
Normal file
25
tests/asset.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user