Add test for edge case: verify regex doesn't match partial path segments

Co-authored-by: Siumauricio <47042324+Siumauricio@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-20 06:56:14 +00:00
parent f314c2f161
commit 2c8eb54d7b

View File

@@ -68,4 +68,14 @@ describe("Azure OpenAI URL Normalization", () => {
// Should only strip the last /v1
expect(result).toBe("https://workspacename.openai.azure.com/openai/v1");
});
it("should not strip partial matches in path segments", () => {
const input = "https://workspacename.openai.azure.com/myopenai/v1service";
const result = normalizeAzureUrl(input);
// Should not modify paths that don't end with /openai/v1 or /v1
expect(result).toBe(
"https://workspacename.openai.azure.com/myopenai/v1service",
);
});
});