()
| 1128 | 49, |
| 1129 | ); |
| 1130 | } |
| 1131 | |
| 1132 | #[test] |
| 1133 | fn match_unit_variants_with_wildcard() { |
| 1134 | // Unit variants carry no payload; the wildcard covers the rest. Green is tag 1. |
| 1135 | assert_exit( |
| 1136 | r#" |
| 1137 | enum Color { |
| 1138 | Red |
| 1139 | Green |
| 1140 | Blue |
| 1141 | } |
| 1142 | |
| 1143 | main: () -> i32 { |
| 1144 | c: Color = Green |
| 1145 | match c { |
| 1146 | Red -> { |
| 1147 | return 1 |
| 1148 | } |
| 1149 | Green -> { |
| 1150 | return 2 |
| 1151 | } |
| 1152 | _ -> { |
| 1153 | return 99 |
| 1154 | } |
| 1155 | } |
| 1156 | return -1 |
| 1157 | } |
nothing calls this directly
no test coverage detected