Skip to content

Commit

Permalink
Test for broken quoted property access
Browse files Browse the repository at this point in the history
  • Loading branch information
wyozi authored and harttle committed Oct 9, 2020
1 parent e67c3c6 commit 30dffb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/unit/parser/tokenizer.ts
Expand Up @@ -39,6 +39,10 @@ describe('Tokenize', function () {
expect(value).to.be.instanceOf(PropertyAccessToken)
expect((value as PropertyAccessToken).variable.getText()).to.equal('"a prop"')
})
it('should throw for broken quoted property access', () => {
const tokenizer = new Tokenizer('[5]')
expect(() => tokenizer.readValueOrThrow()).to.throw()
})
it('should throw for incomplete quoted property access', () => {
const tokenizer = new Tokenizer('["a prop"')
expect(() => tokenizer.readValueOrThrow()).to.throw()
Expand Down

0 comments on commit 30dffb6

Please sign in to comment.