use super::SitePath;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SiteAsset {
pub path: SitePath,
pub bytes: Vec<u8>,
}
impl SiteAsset {
pub fn new(path: SitePath, bytes: Vec<u8>) -> Self {
SiteAsset { path, bytes }
}
}
#[cfg(test)]
pub mod strategy {
use super::*;
use proptest::prelude::*;
pub fn site_asset() -> impl Strategy<Value = SiteAsset> {
(
super::super::site_path::strategy::site_path(),
proptest::collection::vec(any::<u8>(), 0..200),
)
.prop_map(|(path, bytes)| SiteAsset::new(path, bytes))
}
}