diff options
Diffstat (limited to 'crates/ra_hir_ty/src/_match.rs')
-rw-r--r-- | crates/ra_hir_ty/src/_match.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/_match.rs b/crates/ra_hir_ty/src/_match.rs index 8b9bdb7cd..f502a9208 100644 --- a/crates/ra_hir_ty/src/_match.rs +++ b/crates/ra_hir_ty/src/_match.rs | |||
@@ -866,6 +866,41 @@ mod tests { | |||
866 | } | 866 | } |
867 | 867 | ||
868 | #[test] | 868 | #[test] |
869 | fn enum_ref_missing_arms() { | ||
870 | let content = r" | ||
871 | enum Either { | ||
872 | A, | ||
873 | B, | ||
874 | } | ||
875 | fn test_fn() { | ||
876 | match &Either::B { | ||
877 | Either::A => {}, | ||
878 | } | ||
879 | } | ||
880 | "; | ||
881 | |||
882 | check_diagnostic_with_no_fix(content); | ||
883 | } | ||
884 | |||
885 | #[test] | ||
886 | fn enum_ref_no_diagnostic() { | ||
887 | let content = r" | ||
888 | enum Either { | ||
889 | A, | ||
890 | B, | ||
891 | } | ||
892 | fn test_fn() { | ||
893 | match &Either::B { | ||
894 | Either::A => {}, | ||
895 | Either::B => {}, | ||
896 | } | ||
897 | } | ||
898 | "; | ||
899 | |||
900 | check_no_diagnostic(content); | ||
901 | } | ||
902 | |||
903 | #[test] | ||
869 | fn enum_containing_bool_no_arms() { | 904 | fn enum_containing_bool_no_arms() { |
870 | let content = r" | 905 | let content = r" |
871 | enum Either { | 906 | enum Either { |