style(avatars): keep shared pack helpers and tests lint clean

Move the image-key implementation above tests and use fixed-size pixel chunks
in the authored-art test. Keep contract/player byte-identical across the app,
standalone Ratatui and Engine vendor. No runtime behavior changes.

Validation: shared whale crate 44 passed, 0 failed; Ratatui all-targets Clippy
and formatting passed. Prior app gate: npm test 1592 passed / 6 ignored and
check:web passed (86 Python passed / 2 disk-image fixture skips). Native actual
build and visual checks remain valid; this changes ordering and test syntax.
APPS-226.
This commit is contained in:
CodeWhale Bot committed 2026-10-06 22:25:04 -07:00
1 parent a270db7aa6
commit 1156ef814e
2 files changed
+11 -8

No files matched your search

+6 -6
View File
@@ -222,6 +222,12 @@ pub struct RegisteredPack {
pub pack: Pack,
}
impl RegisteredPack {
pub fn image_key(&self, page: usize) -> String {
format!("{}:{}:{}:{page}", self.key, self.content_hash, self.handle)
}
}
#[cfg(test)]
mod tests {
use super::*;
@@ -297,9 +303,3 @@ mod tests {
assert!(p.validate_png(&[]).is_err());
}
}
impl RegisteredPack {
pub fn image_key(&self, page: usize) -> String {
format!("{}:{}:{}:{page}", self.key, self.content_hash, self.handle)
}
}
+5 -2
View File
@@ -62,9 +62,12 @@ mod tests {
);
for index in &clip.frames {
let pixels = tile(*index);
assert!(pixels.chunks_exact(4).any(|p| p[3] > 200), "{act} paints");
assert!(
pixels.chunks_exact(4).any(|p| p[3] == 0),
pixels.as_chunks::<4>().0.iter().any(|p| p[3] > 200),
"{act} paints"
);
assert!(
pixels.as_chunks::<4>().0.iter().any(|p| p[3] == 0),
"{act} is transparent"
);
}