Files
bun.sh/test/internal/powershell-escape.test.ts
2024-09-03 21:32:52 -07:00

11 lines
470 B
TypeScript

import { escapePowershell } from "bun:internal-for-testing";
it("powershell escaping rules", () => {
// This formatter does not include quotes around the string intentionally
expect(escapePowershell("foo")).toBe("foo");
expect(escapePowershell("foo bar")).toBe("foo bar");
expect(escapePowershell('foo" bar')).toBe('foo`" bar');
expect(escapePowershell('foo" `bar')).toBe('foo`" ``bar');
expect(escapePowershell('foo" ``"bar')).toBe('foo`" `````"bar');
});