Merge branch 't3/split-embedded-choices-s-c7b' into t3/s-c7-split-embedded-choices
This commit is contained in:
commit
75758b250c
6 files changed
+142
-47
No files matched your search
@@ -25,15 +25,33 @@ pub(crate) fn rules_md_carries_every_id() {
|
||||
}
|
||||
|
||||
for rule in bookspec_checker::rules().iter() {
|
||||
if rule.is_retired() {
|
||||
continue;
|
||||
}
|
||||
if rule.b == 0 {
|
||||
// Born after the B-n numbering ended (P14 unit S-C7): no index
|
||||
// row and no B-n section; its pick is recorded in the claims
|
||||
// file of its parent.
|
||||
assert!(
|
||||
all.contains(&format!("**Pick ({}):**", rule.id)),
|
||||
"{} carries its pick in its claims file",
|
||||
rule.id
|
||||
);
|
||||
// A rule born after the B numbering has no row in the index.
|
||||
// A CHOICE record split out of another rule (P14 unit S-C7)
|
||||
// has its pick recorded in its claims file, and the engine's
|
||||
// adapter declares the same option, which the record names.
|
||||
if rule.status == Some(bookspec_checker::Status::Choice) {
|
||||
let marker = format!("**Pick ({}):** `", rule.id);
|
||||
let at = all
|
||||
.find(&marker)
|
||||
.unwrap_or_else(|| panic!("{} carries its pick in its claims file", rule.id));
|
||||
let option = all[at + marker.len()..].split('`').next().unwrap();
|
||||
assert!(
|
||||
rule.record().options.iter().any(|o| o.name == option),
|
||||
"{}'s pick {option:?} is one of its options",
|
||||
rule.id
|
||||
);
|
||||
assert!(
|
||||
engine::PICKS
|
||||
.iter()
|
||||
.any(|&(area, n, o)| RuleId::new(area, n) == rule.id && o == option),
|
||||
"{}'s pick {option:?} is declared in the adapter's claims()",
|
||||
rule.id
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
assert!(
|
||||
|
||||
Reference in new issue
Block a user