mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 15:00:42 -07:00
Add incomplete quoted property access test
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 incomplete quoted property access', () => {
|
||||||
|
const tokenizer = new Tokenizer('["a prop"]')
|
||||||
|
expect(() => tokenizer.readValue()).to.throw()
|
||||||
|
})
|
||||||
it('should read hash', () => {
|
it('should read hash', () => {
|
||||||
const hash1 = new Tokenizer('foo: 3').readHash()
|
const hash1 = new Tokenizer('foo: 3').readHash()
|
||||||
expect(hash1!.name.content).to.equal('foo')
|
expect(hash1!.name.content).to.equal('foo')
|
||||||
|
|||||||
Reference in New Issue
Block a user