Add test for last falltrough switch case

This commit is contained in:
Igor Shaposhnik authored and João Capucho committed 2021-10-27 11:12:35 +01:00
1 parent 0458f0a404
commit d1cfdd15a0
1 file changed
+21
+21
View File
@@ -988,3 +988,24 @@ fn select() {
if name.starts_with("select_")
}
}
#[test]
fn last_case_falltrough() {
check_validation_error! {
"
fn test_falltrough() {
switch(0) {
case 0: {
fallthrough;
}
}
}
":
Err(
naga::valid::ValidationError::Function {
error: naga::valid::FunctionError::LastCaseFallTrough,
..
},
)
}
}