diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/parser.spec.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/parser.spec.ts b/tests/parser.spec.ts index 494bb51..16480e6 100644 --- a/tests/parser.spec.ts +++ b/tests/parser.spec.ts @@ -267,5 +267,23 @@ describe('parser', () => { }), ]) }) + + it('parses calc expression with vars', () => { + expect(parse(`calc(5px * var(--value))`)).toEqual([ + Expr.Call({ + name: 'calc', + args: [ + Expr.BinOp({ + op: '*', + left: Expr.LiteralNumber({ value: 5, unit: 'px' }), + right: Expr.Call({ + name: 'var', + args: [Expr.VarIdentifier('--value')], + }), + }), + ], + }), + ]) + }) }) }) |
