mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 15:00:42 -07:00
Test for broken quoted property access
This commit is contained in:
@@ -39,6 +39,10 @@ describe('Tokenize', function () {
|
|||||||
expect(value).to.be.instanceOf(PropertyAccessToken)
|
expect(value).to.be.instanceOf(PropertyAccessToken)
|
||||||
expect((value as PropertyAccessToken).variable.getText()).to.equal('"a prop"')
|
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', () => {
|
it('should throw for incomplete quoted property access', () => {
|
||||||
const tokenizer = new Tokenizer('["a prop"')
|
const tokenizer = new Tokenizer('["a prop"')
|
||||||
expect(() => tokenizer.readValueOrThrow()).to.throw()
|
expect(() => tokenizer.readValueOrThrow()).to.throw()
|
||||||
|
|||||||
Reference in New Issue
Block a user