Skip to content

Commit 4f117b8

Browse files
committed
chore(x-android): 移除 transformText 测试例
1 parent 2428fec commit 4f117b8

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

packages/uni-app-uts/__tests__/android/testUtils.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import {
1010
isString,
1111
} from '@vue/shared'
1212

13-
export function assert(
13+
export function compileTemplate(
1414
template: string,
15-
templateCode: string,
1615
options: Omit<TemplateCompilerOptions, 'rootDir'> = {
1716
targetLanguage: 'kotlin',
1817
}
@@ -29,7 +28,17 @@ export function assert(
2928
)
3029
},
3130
}
32-
const res = compile(template, compilerOptions)
31+
return compile(template, compilerOptions)
32+
}
33+
34+
export function assert(
35+
template: string,
36+
templateCode: string,
37+
options: Omit<TemplateCompilerOptions, 'rootDir'> = {
38+
targetLanguage: 'kotlin',
39+
}
40+
) {
41+
const res = compileTemplate(template, options)
3342
if (typeof expect !== 'undefined') {
3443
expect((res.preamble || '') + res.code).toBe(templateCode)
3544
}

packages/uni-app-uts/__tests__/android/transforms/transformText.spec.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,6 @@ describe('compiler: transform text', () => {
2121
_cE("view", null, "ccc" + _tD(_ctx.ddd), 1 /* TEXT */),
2222
_tD(_ctx.eee) + "fff",
2323
_cE("text", null, _tD(_ctx.ggg), 1 /* TEXT */)
24-
])`
25-
)
26-
})
27-
test('\n', () => {
28-
assert(
29-
`<view>
30-
<text>\\\\\n 换行</text>
31-
<text>\\\\n 换行</text>
32-
<text>\\\n 换行</text>
33-
<text>\\n 换行</text>
34-
<text>\n 换行</text>
35-
<text>\n 换行 \\n 换行 \\\n 换行 \\\\n 换行 \\\\\n 换行</text>
36-
</view>`,
37-
`_cE(\"view\", null, [
38-
_cE(\"text\", null, \"\\\\\\\\ 换行\"),
39-
_cE(\"text\", null, \"\\n 换行\"),
40-
_cE(\"text\", null, \"\\\\ 换行\"),
41-
_cE(\"text\", null, \"\\n 换行\"),
42-
_cE(\"text\", null, \" 换行\"),
43-
_cE(\"text\", null, \" 换行 \\n 换行 \\\\ 换行 \\\\\\n 换行 \\\\\\\\ 换行\")
4424
])`
4525
)
4626
})

0 commit comments

Comments
 (0)