test: update tests

This commit is contained in:
daiwei 2024-12-30 17:20:33 +08:00
parent 8ca43b5c93
commit b0a2ce5b0e
4 changed files with 28 additions and 28 deletions

View File

@ -35,13 +35,13 @@ export function render(_ctx) {
const _directive_test = _resolveDirective("test")
const n4 = _createComponentWithFallback(_component_Comp, null, {
"default": () => {
const n0 = _createIf(() => (true), () => {
const n0 = _createIf(() => (true) && (() => {
const n3 = t0()
const n2 = _createComponentWithFallback(_component_Bar)
_withDirectives(n2, [[_directive_hello, void 0, void 0, { world: true }]])
_insert(n2, n3)
return n3
})
}))
return n0
}
}, true)

View File

@ -34,11 +34,11 @@ const t0 = _template("<div></div>", true)
export function render(_ctx) {
const _setTemplateRef = _createTemplateRefSetter()
const n0 = _createIf(() => (true), () => {
const n0 = _createIf(() => (true) && (() => {
const n2 = t0()
_setTemplateRef(n2, "foo")
return n2
})
}))
return n0
}"
`;

View File

@ -5,11 +5,11 @@ exports[`compiler: v-if > basic v-if 1`] = `
const t0 = _template("<div></div>", true)
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) && (() => {
const n2 = t0()
_renderEffect(() => _setText(n2, _ctx.msg))
return n2
})
}))
return n0
}"
`;
@ -25,18 +25,18 @@ const t5 = _template("<input>")
export function render(_ctx) {
const n13 = t5()
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
}, () => _createIf(() => (_ctx.orNot), () => {
} : () => (_ctx.orNot) ? () => {
const n5 = t1()
const n6 = t2()
return [n5, n6]
}, () => {
} : () => {
const n10 = t3()
const n11 = t4()
return [n10, n11]
}))
})
_renderEffect(() => _setText(n13, _ctx.text))
return [n0, n13]
}"
@ -47,14 +47,14 @@ exports[`compiler: v-if > dedupe same template 1`] = `
const t0 = _template("<div>hello</div>")
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) && (() => {
const n2 = t0()
return n2
})
const n3 = _createIf(() => (_ctx.ok), () => {
}))
const n3 = _createIf(() => (_ctx.ok) && (() => {
const n5 = t0()
return n5
})
}))
return [n0, n3]
}"
`;
@ -66,13 +66,13 @@ const t1 = _template("hello")
const t2 = _template("<p></p>", true)
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) && (() => {
const n2 = t0()
const n3 = t1()
const n4 = t2()
_renderEffect(() => _setText(n4, _ctx.msg))
return [n2, n3, n4]
})
}))
return n0
}"
`;
@ -83,10 +83,10 @@ const t0 = _template("<div></div>")
const t1 = _template("<p></p>")
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
}, () => {
} : () => {
const n4 = t1()
return n4
})
@ -101,16 +101,16 @@ const t1 = _template("<p></p>")
const t2 = _template("fine")
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
}, () => _createIf(() => (_ctx.orNot), () => {
} : () => (_ctx.orNot) ? () => {
const n4 = t1()
return n4
}, () => {
} : () => {
const n7 = t2()
return n7
}))
})
return n0
}"
`;
@ -121,10 +121,10 @@ const t0 = _template("<div></div>")
const t1 = _template("<p></p>")
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok), () => {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
}, () => _createIf(() => (_ctx.orNot), () => {
} : () => (_ctx.orNot) && (() => {
const n4 = t1()
return n4
}))

View File

@ -78,10 +78,10 @@ exports[`compiler: v-once > with v-if 1`] = `
const t0 = _template("<div></div>", true)
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.expr), () => {
const n0 = _createIf(() => (_ctx.expr) && (() => {
const n2 = t0()
return n2
}, null, true)
}), true)
return n0
}"
`;
@ -92,10 +92,10 @@ const t0 = _template("<div></div>")
const t1 = _template("<p></p>")
export function render(_ctx) {
const n0 = _createIf(() => (_ctx.expr), () => {
const n0 = _createIf(() => (_ctx.expr) ? () => {
const n2 = t0()
return n2
}, () => {
} : () => {
const n4 = t1()
return n4
}, true)