From abfaf8a042739ffcc0f5720207aad89dce24cfd0 Mon Sep 17 00:00:00 2001 From: wyozi Date: Fri, 9 Oct 2020 14:37:43 +0300 Subject: [PATCH] Test quoted property access tokenizing --- test/unit/parser/tokenizer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/parser/tokenizer.ts b/test/unit/parser/tokenizer.ts index 97cd44cde..c719558b8 100644 --- a/test/unit/parser/tokenizer.ts +++ b/test/unit/parser/tokenizer.ts @@ -34,6 +34,11 @@ describe('Tokenize', function () { it('should read property access value', () => { expect(new Tokenizer('a[b]["c d"]').readValueOrThrow().getText()).to.equal('a[b]["c d"]') }) + it('should read quoted property access value', () => { + const value = new Tokenizer('["a prop"]').readValue() + expect(value).to.be.instanceOf(PropertyAccessToken) + expect((value as PropertyAccessToken).variable.getText()).to.equal('"a prop"') + }) it('should read hash', () => { const hash1 = new Tokenizer('foo: 3').readHash() expect(hash1!.name.content).to.equal('foo')