Skip to content

Commit

Permalink
WIP: add tests for enable extension parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Nov 4, 2024
1 parent 9ccea81 commit fdc5a56
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions naga/src/front/wgsl/parse/directive/enable_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ impl EnableExtension {

/// A variant of [`EnableExtension::Implemented`].
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(test, derive(strum::EnumIter))]
pub enum ImplementedEnableExtension {}

/// A variant of [`EnableExtension::Unimplemented`].
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(test, derive(strum::EnumIter))]
pub enum UnimplementedEnableExtension {
/// Enables `f16`/`half` primitive support in all shader languages.
///
Expand Down Expand Up @@ -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() {}
}

0 comments on commit fdc5a56

Please sign in to comment.