blob: a6dffbd6a71b45fef7a2f36ab0258c064b354793 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { expect, it } from "bun:test";
import { bunRunAsScript, tempDirWithFiles } from "harness";
it("should handle quote escapes", () => {
const package_json = JSON.stringify({
scripts: {
test: `echo "test\\\\$(pwd)"`,
},
});
expect(package_json).toContain('\\"');
expect(package_json).toContain("\\\\");
const dir = tempDirWithFiles("run-quote", { "package.json": package_json });
const { stdout } = bunRunAsScript(dir, "test");
expect(stdout).toBe(`test\\${dir}`);
});
|