901 B49 lines
Blame
1import { describe, expect, it } from 'vitest';
2
3import { Info } from '../src/language/index.js';
4import { expectNoErrorsOrAlternatives, infoParse as parse } from './test-util.js';
5
6describe('info', () => {
7 it.each([
8 `info`,
9 `
10 info`,
11 `info
12 `,
13 `
14 info
15 `,
16 ])('should handle empty info', (context: string) => {
17 const result = parse(context);
18 expectNoErrorsOrAlternatives(result);
19 expect(result.value.$type).toBe(Info.$type);
20 });
21
22 it.each([
23 `info showInfo`,
24 `info showInfo
25 `,
26 `
27 info showInfo`,
28 `info
29 showInfo`,
30 `info
31 showInfo
32 `,
33 `
34 info
35 showInfo
36 `,
37 `
38 info
39 showInfo`,
40 `
41 info showInfo
42 `,
43 ])('should handle showInfo', (context: string) => {
44 const result = parse(context);
45 expectNoErrorsOrAlternatives(result);
46 expect(result.value.$type).toBe(Info.$type);
47 });
48});
49