WIP: add tests for enable extension parsing

This commit is contained in:
Erich Gubler 2024-10-21 21:11:54 -04:00
parent 0b82776947
commit 3062d40a3d

View File

@ -76,10 +76,12 @@ impl EnableExtension {
/// A variant of [`EnableExtension::Implemented`]. /// A variant of [`EnableExtension::Implemented`].
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(test, derive(strum::EnumIter))]
pub enum ImplementedEnableExtension {} pub enum ImplementedEnableExtension {}
/// A variant of [`EnableExtension::Unimplemented`]. /// A variant of [`EnableExtension::Unimplemented`].
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(test, derive(strum::EnumIter))]
pub enum UnimplementedEnableExtension { pub enum UnimplementedEnableExtension {
/// Enables `f16`/`half` primitive support in all shader languages. /// Enables `f16`/`half` primitive support in all shader languages.
/// ///
@ -110,3 +112,15 @@ impl UnimplementedEnableExtension {
} }
} }
} }
#[cfg(test)]
mod test {
use strum::IntoEnumIterator as _;
use super::ImplementedEnableExtension;
fn valid() {
for extension in ImplementedEnableExtension::iter() {}
}
fn unimplemented() {}
}