Commit 787fef5
committed
test(conformance): the index matcher was pinned to one spelling (apcore#112)
The driver read the refused rule index with `/Rule (\d+)/`. The two axis
families are raised from different code paths and need not word the index
identically — this SDK's per-rule validator says `Rule 0 has invalid
effect`, while apcore-rust's loader-only key axis says `ACL rule 1 in
'<file>' carries 'priority' unrecognised` — and a matcher pinned to one
spelling reads the other as naming NO rule. That is a silent pass on
`lowest_indexed_bad_rule_wins_over_a_loader_only_axis`, the case built to
catch a real bug.
**This SDK's spellings do not differ**: every rejection it raises, the
rule-key closure included, opens with `Rule N` — measured across all seven
loader messages. So nothing was passing falsely here. The driver is
hardened anyway, because its job is to detect a divergence rather than to
encode this implementation's current phrasing, and a message reworded later
would have degraded to a false pass rather than a failure.
`ruleIndicesNamed()` now matches `\brules?\s+(\d+)\b` case-insensitively and
returns every index found, and the assertion requires the whole set to be
exactly the expected one — so "names no rule", "names the wrong rule" and
"names two rules" all fail rather than the first two passing. Prose about
"the rule" is not a hit: a digit must follow the word, or this SDK's own
pattern-shape message ("makes the rule inert") would read as naming rule 0.
`default_effect_is_judged_before_any_rule` asserts the index set is EMPTY
rather than that a regex failed to match, so a wording the driver does not
recognise cannot read as "no index present" — the same trap pointing the
other way. A driver self-test pins the matcher against both spellings, the
two-index case and the two prose non-hits, so this cannot come back
silently.
The SDK-local suite gets the same treatment where it asserts an index is
absent, plus a test that both of this SDK's axis families word the index the
same way — the thing that would have to change for the trap to matter here.
Refs: apcore#112
Signed-off-by: tercel <tercel.yi@gmail.com>1 parent 57b718e commit 787fef5
2 files changed
Lines changed: 81 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
605 | 610 | | |
606 | 611 | | |
607 | 612 | | |
| |||
622 | 627 | | |
623 | 628 | | |
624 | 629 | | |
625 | | - | |
| 630 | + | |
626 | 631 | | |
627 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
628 | 651 | | |
629 | 652 | | |
630 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
| |||
304 | 311 | | |
305 | 312 | | |
306 | 313 | | |
307 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
308 | 324 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
315 | 341 | | |
316 | 342 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
320 | 348 | | |
321 | 349 | | |
322 | 350 | | |
| |||
339 | 367 | | |
340 | 368 | | |
341 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
342 | 387 | | |
343 | 388 | | |
344 | 389 | | |
| |||
0 commit comments