Skip to content

Commit 600840d

Browse files
WIP: add tests for enable extension parsing
1 parent 8c13d8f commit 600840d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

naga/src/front/wgsl/parse/directive/enable_extension.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ impl EnableExtension {
7676

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

8182
/// A variant of [`EnableExtension::Unimplemented`].
8283
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
84+
#[cfg_attr(test, derive(strum::EnumIter))]
8385
pub enum UnimplementedEnableExtension {
8486
/// Enables `f16`/`half` primitive support in all shader languages.
8587
///
@@ -110,3 +112,15 @@ impl UnimplementedEnableExtension {
110112
}
111113
}
112114
}
115+
#[cfg(test)]
116+
mod test {
117+
use strum::IntoEnumIterator as _;
118+
119+
use super::ImplementedEnableExtension;
120+
121+
fn valid() {
122+
for extension in ImplementedEnableExtension::iter() {}
123+
}
124+
125+
fn unimplemented() {}
126+
}

0 commit comments

Comments
 (0)