added parser

This commit is contained in:
Austin Fulbright
2024-07-25 05:25:19 -04:00
parent 1a95d48852
commit d0eadebb99
5 changed files with 111 additions and 11 deletions

View File

@@ -8,11 +8,23 @@ describe('gitGraph', () => {
const result = parse(`gitGraph`);
expect(result.value.$type).toBe(GitGraph);
expect(result.value.statements).toHaveLength(0);
expect(result.lexerErrors).toHaveLength(0);
expect(result.parserErrors).toHaveLength(0);
});
it('should handle gitGraph with one statement', () => {
const result = parse(`gitGraph\n A`);
const result = parse(`gitGraph\n commit\n`);
expect(result.value.$type).toBe(GitGraph);
expect(result.lexerErrors).toHaveLength(0);
expect(result.parserErrors).toHaveLength(0);
expect(result.value.statements).toHaveLength(1);
});
it('should handle gitGraph with multiple statements and use accTitle', () => {
const result = parse(`gitGraph\n commit\n commit\n accTitle: title\n commit\n`);
expect(result.value.$type).toBe(GitGraph);
expect(result.lexerErrors).toHaveLength(0);
expect(result.parserErrors).toHaveLength(0);
});
});
});