Files
open-design/tools/pack/tests/win-registry.test.ts
4b48f94b7c refactor(ci): align tools-pack sources with scope boundaries (#7230)
* refactor(ci): align tools-pack sources with scope boundaries

* refactor(tools-pack): unify test source imports

* fix(tools-pack): resolve workspace root from package

Generated-By: looper 0.11.2 (runner=fixer, agent=codex)

* test(tools-pack): exercise bundled CLI directly

---------

Co-authored-by: Looper <looper@noreply.github.com>
2026-08-21 07:56:48 +00:00

33 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { stripRegistryQuotedValue } from "@/win/registry.js";
describe("stripRegistryQuotedValue", () => {
it("returns the quoted body when the value is fully quoted", () => {
expect(stripRegistryQuotedValue('"C:\\Program Files\\Open Design\\Uninstall.exe"')).toBe(
"C:\\Program Files\\Open Design\\Uninstall.exe",
);
});
it("returns the inner segment when the quoted region carries trailing flags", () => {
expect(stripRegistryQuotedValue('"C:\\Program Files\\Open Design\\Uninstall.exe" /S')).toBe(
"C:\\Program Files\\Open Design\\Uninstall.exe",
);
});
it("trims unquoted values and leaves them otherwise unchanged", () => {
expect(stripRegistryQuotedValue(" C:\\Open Design\\Uninstall.exe ")).toBe(
"C:\\Open Design\\Uninstall.exe",
);
});
it("returns an empty string for null or undefined input", () => {
expect(stripRegistryQuotedValue(null)).toBe("");
expect(stripRegistryQuotedValue(undefined)).toBe("");
});
it("returns the trimmed value when only a leading quote is present", () => {
expect(stripRegistryQuotedValue('"unterminated')).toBe('"unterminated');
});
});