Files
bun.sh/test/snippets/template-literal.js
Jarred Sumner 9388b3f825 Add a zig fmt action (#2277)
* Add a zig fmt action

* add failing file

* Setup prettier better

* Update prettier-fmt.yml

* Fail on error

* Update prettier-fmt.yml

* boop

* boop2

* tar.gz

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* boop

* Update prettier-fmt.yml

* tag

* newlines

* multiline

* fixup

* Update zig-fmt.yml

* update it

* fixup

* both

* w

* Update prettier-fmt.yml

* prettier all the things

* Update package.json

* zig fmt

*  

* bump

* .

* quotes

* fix prettier ignore

* once more

* Update prettier-fmt.yml

* Update fallback.ts

* consistentcy

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-02 19:02:10 -08:00

45 lines
844 B
JavaScript

const css = templ => templ.toString();
const fooNoBracesUTF8 = css`
before
/* */
after
`;
const fooNoBracesUT16 = css`
before
🙃
after
`;
const fooUTF8 = css`
before
${true}
after
`;
const fooUTF16 = css`
before
🙃 ${true}
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(foo.includes("before"), `Expected ${foo} to include "before"`);
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);
}