Skip to content

Commit cd3e94f

Browse files
committed
add back old SchemaCoordinateLexer tests
1 parent cccea34 commit cd3e94f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/language/__tests__/schemaCoordinateLexer-test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ describe('SchemaCoordinateLexer', () => {
3030
);
3131
});
3232

33+
it('tracks a schema coordinate', () => {
34+
const lexer = new SchemaCoordinateLexer(new Source('Name.field'));
35+
expect(lexer.advance()).to.contain({
36+
kind: TokenKind.NAME,
37+
start: 0,
38+
end: 4,
39+
value: 'Name',
40+
});
41+
});
42+
43+
it('forbids ignored tokens', () => {
44+
const lexer = new SchemaCoordinateLexer(new Source('\nName.field'));
45+
expectToThrowJSON(() => lexer.advance()).to.deep.equal({
46+
message: 'Syntax Error: Invalid character: U+000A.',
47+
locations: [{ line: 1, column: 1 }],
48+
});
49+
});
50+
3351
it('ignores BOM header', () => {
3452
expect(lexOne('\uFEFFfoo')).to.contain({
3553
kind: TokenKind.NAME,

0 commit comments

Comments
 (0)