mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
[JS Parser] Add regression test
This commit is contained in:
@@ -24,6 +24,15 @@ const fooUTF16 = css`
|
||||
after
|
||||
|
||||
`;
|
||||
|
||||
const templateLiteralWhichDefinesAFunction = ((...args) =>
|
||||
args[args.length - 1]().toString())`
|
||||
before
|
||||
🙃 ${() => true}
|
||||
after
|
||||
|
||||
`;
|
||||
|
||||
export function test() {
|
||||
for (let foo of [fooNoBracesUT16, fooNoBracesUTF8, fooUTF16, fooUTF8]) {
|
||||
console.assert(
|
||||
@@ -33,5 +42,10 @@ export function test() {
|
||||
console.assert(foo.includes("after"), `Expected ${foo} to include "after"`);
|
||||
}
|
||||
|
||||
console.assert(
|
||||
templateLiteralWhichDefinesAFunction.includes("true"),
|
||||
"Expected fooFunction to include 'true'"
|
||||
);
|
||||
|
||||
return testDone(import.meta.url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user