(text: string, expected?: string)
| 1961 | |
| 1962 | describe('error recovery', () => { |
| 1963 | function recover(text: string, expected?: string) { |
| 1964 | const expr = validate(parseAction(text)); |
| 1965 | expect(unparse(expr)).toEqual(expected || text); |
| 1966 | } |
| 1967 | it('should be able to recover from an extra paren', () => recover('((a)))', '((a))')); |
| 1968 | it('should be able to recover from an extra bracket', () => recover('[[a]]]', '[[a]]')); |
| 1969 | it('should be able to recover from a missing )', () => recover('(a;b', '(a); b;')); |
no test coverage detected