Skip to content

Commit

Permalink
Added a test case to #1634
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuebner committed Aug 23, 2024
1 parent af06840 commit 50a1a3e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/langium/test/grammar/grammar-validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1039,3 +1039,19 @@ describe('Prohibit empty parser rules', async () => {
detectEmptyRules(validationResult, 'EmptyItem');
});
});

describe('Check validation is not crashing', async () => {

test('Calling missing terminal rule', async () => {
const specialGrammar = `
grammar Foo
entry Foo:
TERMINAL;
terminal TERMINAL returns string:
MISSING_TERMINAL;
`;
const validationResult = await validate(specialGrammar);
expect(validationResult).toBeDefined();
});
});

0 comments on commit 50a1a3e

Please sign in to comment.