From 93db57c12b4a5eff48bdd00c494efa5ec89567ad Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 16 Jun 2021 14:42:20 -0700 Subject: [PATCH] [wgsl-in] Test validation of arrays with zero and negative lengths. --- tests/wgsl-errors.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/wgsl-errors.rs b/tests/wgsl-errors.rs index 8f3f9ad8f..a99cd96aa 100644 --- a/tests/wgsl-errors.rs +++ b/tests/wgsl-errors.rs @@ -606,6 +606,15 @@ fn invalid_arrays() { .. }) } + + check_validation_error! { + "type Bad = array;", + "type Bad = array;": + Err(naga::valid::ValidationError::Type { + error: naga::valid::TypeError::NonPositiveArrayLength(_), + .. + }) + } } #[test]