(src: string)
| 68 | |
| 69 | describe('error location', () => { |
| 70 | const exeAndGetErrPos = (src: string): Promise<Ast.Pos|undefined> => new Promise((ok, ng) => { |
| 71 | const aiscript = new Interpreter({ |
| 72 | emitError: FN_NATIVE((_args, _opts) => { |
| 73 | throw Error('emitError'); |
| 74 | }), |
| 75 | }, { |
| 76 | err(e) { ok(e.pos) }, |
| 77 | }); |
| 78 | aiscript.exec(Parser.parse(src)).then(() => ng('error has not occured.')); |
| 79 | }); |
| 80 | |
| 81 | test.concurrent('Non-aiscript Error', async () => { |
| 82 | return expect(exeAndGetErrPos(`/* (の位置 |
no test coverage detected