[wgsl-in]: Move WGSL front end integration tests into a WGSL-specific file.

This lets us reduce noise by removing a bunch of `#[cfg]` attributes. In the
future, if we have tests for other front ends, we can create an `errors`
subdirectory, but for now, we only have the WGSL tests, so we should keep things
flat.
This commit is contained in:
Jim Blandy
2021-05-13 10:21:43 -07:00
committed by Dzmitry Malyshau
parent 5e5d64291d
commit f45d812266

View File

@@ -1,4 +1,6 @@
#[cfg(feature = "wgsl-in")]
//! Tests for the WGSL front end.
#![cfg(feature = "wgsl-in")]
fn check(input: &str, snapshot: &str) {
let output = naga::front::wgsl::parse_str(input)
.expect_err("expected parser error")
@@ -15,7 +17,6 @@ fn check(input: &str, snapshot: &str) {
}
}
#[cfg(feature = "wgsl-in")]
#[test]
fn function_without_identifier() {
check(
@@ -30,7 +31,6 @@ fn function_without_identifier() {
);
}
#[cfg(feature = "wgsl-in")]
#[test]
fn invalid_integer() {
check(
@@ -45,7 +45,6 @@ fn invalid_integer() {
);
}
#[cfg(feature = "wgsl-in")]
#[test]
fn invalid_float() {
check(
@@ -60,7 +59,6 @@ fn invalid_float() {
);
}
#[cfg(feature = "wgsl-in")]
#[test]
fn invalid_scalar_width() {
check(