From: Evan You Date: Sun, 23 Jan 2022 13:03:37 +0000 (+0800) Subject: test: add missing edge case for css v-bind X-Git-Tag: v3.2.29~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=059c63eab7e1e62a400a6608989f4a8545c097c6;p=thirdparty%2Fvuejs%2Fcore.git test: add missing edge case for css v-bind --- diff --git a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap index c290eb6fee..49b0d712a7 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap @@ -75,6 +75,7 @@ export default { _useCssVars(_ctx => ({ \\"xxxxxxxx-foo\\": (_unref(foo)), + \\"xxxxxxxx-foo____px_\\": (_unref(foo) + 'px'), \\"xxxxxxxx-_a___b____2____px_\\": ((_unref(a) + _unref(b)) / 2 + 'px'), \\"xxxxxxxx-__a___b______2___a_\\": (((_unref(a) + _unref(b))) / (2 * _unref(a))) })) diff --git a/packages/compiler-sfc/__tests__/cssVars.spec.ts b/packages/compiler-sfc/__tests__/cssVars.spec.ts index f92852e859..d9912f44b5 100644 --- a/packages/compiler-sfc/__tests__/cssVars.spec.ts +++ b/packages/compiler-sfc/__tests__/cssVars.spec.ts @@ -210,6 +210,7 @@ describe('CSS vars injection', () => { p{ width: calc(v-bind(foo) - 3px); height: calc(v-bind('foo') - 3px); + top: calc(v-bind(foo + 'px') - 3px); } div { color: v-bind((a + b) / 2 + 'px' ); @@ -224,6 +225,7 @@ describe('CSS vars injection', () => { ) expect(content).toMatch(`_useCssVars(_ctx => ({ "${mockId}-foo": (_unref(foo)), + "${mockId}-foo____px_": (_unref(foo) + 'px'), "${mockId}-_a___b____2____px_": ((_unref(a) + _unref(b)) / 2 + 'px'), "${mockId}-__a___b______2___a_": (((_unref(a) + _unref(b))) / (2 * _unref(a))) })`)