diff options
Diffstat (limited to 'crates/test_utils/src/fixture.rs')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 535892f3f..779146084 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -276,6 +276,7 @@ impl MiniCore { | |||
276 | } | 276 | } |
277 | 277 | ||
278 | let mut curr_region = ""; | 278 | let mut curr_region = ""; |
279 | let mut seen_regions = Vec::new(); | ||
279 | for line in lines { | 280 | for line in lines { |
280 | let trimmed = line.trim(); | 281 | let trimmed = line.trim(); |
281 | if let Some(region) = trimmed.strip_prefix("// region:") { | 282 | if let Some(region) = trimmed.strip_prefix("// region:") { |
@@ -288,6 +289,7 @@ impl MiniCore { | |||
288 | curr_region = ""; | 289 | curr_region = ""; |
289 | continue; | 290 | continue; |
290 | } | 291 | } |
292 | seen_regions.push(curr_region); | ||
291 | 293 | ||
292 | let mut flag = curr_region; | 294 | let mut flag = curr_region; |
293 | if let Some(idx) = trimmed.find("// :") { | 295 | if let Some(idx) = trimmed.find("// :") { |
@@ -305,6 +307,13 @@ impl MiniCore { | |||
305 | buf.push_str(line) | 307 | buf.push_str(line) |
306 | } | 308 | } |
307 | } | 309 | } |
310 | |||
311 | for flag in &self.valid_flags { | ||
312 | if !seen_regions.iter().any(|it| it == flag) { | ||
313 | panic!("unused minicore flag: {:?}", flag); | ||
314 | } | ||
315 | } | ||
316 | |||
308 | buf | 317 | buf |
309 | } | 318 | } |
310 | } | 319 | } |