Assert `blank` removes exactly `macros` from `input` and nothing else, offsets kept.
(blank: (s: string) => string, input: string, macros: string[])
| 36 | |
| 37 | /** Assert `blank` removes exactly `macros` from `input` and nothing else, offsets kept. */ |
| 38 | function expectBlanked(blank: (s: string) => string, input: string, macros: string[]): void { |
| 39 | const out = blank(input); |
| 40 | expect(out.length).toBe(input.length); |
| 41 | let expected = input; |
| 42 | for (const macro of macros) { |
| 43 | const at = expected.indexOf(macro); |
| 44 | expect(at, `${macro} in ${input}`).toBeGreaterThanOrEqual(0); |
| 45 | expected = expected.slice(0, at) + macro.replace(/[^\r\n]/g, ' ') + expected.slice(at + macro.length); |
| 46 | } |
| 47 | expect(out).toBe(expected); |
| 48 | } |
| 49 | |
| 50 | describe('C++ attribute-macro blanks', () => { |
| 51 | it('blanks every macro between class and the name, and before a specialization', () => { |
no test coverage detected