Add test for last falltrough switch case

This commit is contained in:
Igor Shaposhnik
2021-10-27 11:59:15 +03:00
committed by João Capucho
parent 0458f0a404
commit d1cfdd15a0

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,
..
},
)
}
}