mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 08:51:05 +01:00
[wgsl] Add parser error snapshot
This commit is contained in:
1 parent
fa7d4d8b51
commit
ce84b1d1c0
1 file changed
+15
@@ -0,0 +1,15 @@
|
||||
#[cfg(feature = "wgsl-in")]
|
||||
macro_rules! err {
|
||||
($value:expr, @$snapshot:literal) => {
|
||||
::insta::assert_snapshot!(naga::front::wgsl::parse_str($value).expect_err("expected parser error").to_string(), @$snapshot);
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(feature = "wgsl-in")]
|
||||
#[test]
|
||||
fn function_without_identifier() {
|
||||
err!(
|
||||
"fn () {}",
|
||||
@"error while parsing WGSL in scopes [FunctionDecl] at line 1 pos 4: unexpected token Paren('('), expected ident"
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user