test(tests): R5.7 census refuses #[ignore] ledger targets

This commit is contained in:
bchanot committed 2026-10-25 13:37:22 +01:00
1 parent ce9768d679
commit cd69f0ea11
1 file changed
+3 -2
+3 -2
View File
@@ -295,9 +295,10 @@ describe('the disposition of the deleted files and tests', () => {
if (cargo) { if (cargo) {
const [, binary, test] = cargo const [, binary, test] = cargo
const files = cargoTargetFile(binary!) const files = cargoTargetFile(binary!)
// A `#[test]` function of that name, not any `fn` (attributes and doc lines between). // A `#[test]` function of that name, not any `fn` (attributes and doc lines between),
// and never an `#[ignore]` one: `cargo test` would skip it and the row would be passive.
const testFn = new RegExp( const testFn = new RegExp(
`#\\[test\\]\\s*(?:(?:#\\[[^\\]]*\\]|///[^\\n]*)\\s*)*fn ${test}\\(`, `#\\[test\\]\\s*(?:(?:#\\[(?!ignore)[^\\]]*\\]|///[^\\n]*)\\s*)*fn ${test}\\(`,
) )
const defined = files.some( const defined = files.some(
(path) => exists(path) && testFn.test(read(path)), (path) => exists(path) && testFn.test(read(path)),