From 8c9022aeb3fadbe2ab27a8c49c103abcfe8db00b Mon Sep 17 00:00:00 2001 From: Onur D Date: Mon, 16 Oct 2023 17:35:15 +0200 Subject: [PATCH] Fixed one test case based on the operating system in order to generate the exception "URI path component is empty". Also, attempted to make tests run and pass both in windows and linux by changing the file separator if the OS is Windows. --- .../core/problem/rest/OpenAPILocalURLIssueTest.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/test/kotlin/org/evomaster/core/problem/rest/OpenAPILocalURLIssueTest.kt b/core/src/test/kotlin/org/evomaster/core/problem/rest/OpenAPILocalURLIssueTest.kt index 99c1175aab..20d73d3d2c 100644 --- a/core/src/test/kotlin/org/evomaster/core/problem/rest/OpenAPILocalURLIssueTest.kt +++ b/core/src/test/kotlin/org/evomaster/core/problem/rest/OpenAPILocalURLIssueTest.kt @@ -137,7 +137,12 @@ class OpenAPILocalURLIssueTest { fun testNonExistingFileInvalidURL() { // get the current directory - val urlToTest = "file:/$swaggerTestDirectory/openapi_pet_non_existent.json" + val urlToTest = if (hostOs.contains("win")) { + "file://$swaggerTestDirectory/openapi_pet_non_existent.json" + } + else { + "file:/$swaggerTestDirectory/openapi_pet_non_existent.json" + } // since the file does not exist and URL is invalid, a valid swagger cannot be created // but an SutException should be thrown