mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 23:04:07 +00:00
[wgsl] Add parser error snapshot
This commit is contained in:
parent
fa7d4d8b51
commit
ce84b1d1c0
15
tests/errors.rs
Normal file
15
tests/errors.rs
Normal file
@ -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"
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user