aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Mcguigan <[email protected]>2020-04-07 23:39:50 +0100
committerJosh Mcguigan <[email protected]>2020-04-08 18:47:05 +0100
commit36c110ee096d46b02aa2a5adfaf138cd8c3872a7 (patch)
tree115e9461072029b942dbb28f35a73fbe3ae34fec
parent941615748d9000e66ff4400ae519dc60410a11f7 (diff)
match checking add additional test for match checking tuple with missing pattern
-rw-r--r--crates/ra_hir_ty/src/_match.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/_match.rs b/crates/ra_hir_ty/src/_match.rs
index 037db5cf8..9e9a9d047 100644
--- a/crates/ra_hir_ty/src/_match.rs
+++ b/crates/ra_hir_ty/src/_match.rs
@@ -1335,6 +1335,20 @@ mod tests {
1335 } 1335 }
1336 1336
1337 #[test] 1337 #[test]
1338 fn malformed_match_arm_tuple_missing_pattern() {
1339 let content = r"
1340 fn test_fn() {
1341 match (0) {
1342 () => (),
1343 }
1344 }
1345 ";
1346
1347 // Match arms with the incorrect type are filtered out.
1348 check_diagnostic(content);
1349 }
1350
1351 #[test]
1338 fn malformed_match_arm_tuple_enum_missing_pattern() { 1352 fn malformed_match_arm_tuple_enum_missing_pattern() {
1339 let content = r" 1353 let content = r"
1340 enum Either { 1354 enum Either {