mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
* 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>
33 lines
1.2 KiB
TypeScript
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');
|
|
});
|
|
});
|