From f70d14caf3f84b15ef7e9e3ecf6863767db7d7b2 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 13 Mar 2024 19:50:43 +0000 Subject: [PATCH] more tests --- src/operand/__test__/unit/reference.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/operand/__test__/unit/reference.test.ts b/src/operand/__test__/unit/reference.test.ts index 0c1dd19..09110d4 100644 --- a/src/operand/__test__/unit/reference.test.ts +++ b/src/operand/__test__/unit/reference.test.ts @@ -26,6 +26,9 @@ describe('Operand - Value', () => { subSubE: [{ subSubSubE: 6 }], }, ], + // key with backticks are acceptable + 'sub`E.dotKey': { subSubE: 7 }, + 'sub`E.dotKey`': { subSubE: 8 }, }, RefD: 'A', RefE: 'D', @@ -69,6 +72,8 @@ describe('Operand - Value', () => { // yield an undefined since this is a wrong syntax to access array item for a key that contains a dot ['RefC.`subD.dotKey[0]`.subSubD', undefined], ['RefC.`subD.dotKey`[0].subSubE[0].subSubSubE', 6], + ['RefC.`sub`E.dotKey`.subSubE', 7], + ['RefC.`sub`E.dotKey``.subSubE', 8], // Missing ['RefB', undefined], ['RefC.subC', undefined],