Skip to content

Commit ad9d2d4

Browse files
committed
tests: repair BuildPlanTests.testSnippets on Windows
Escape the path string to match the read content. This allows this test to pass on Windows improving test coverage.
1 parent 72b184f commit ad9d2d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/BuildTests/BuildPlanTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -4957,10 +4957,10 @@ final class BuildPlanTests: XCTestCase {
49574957
let swiftGetVersionFilePath = try XCTUnwrap(llbuild.swiftGetVersionFiles.first?.value)
49584958

49594959
let yamlContents: String = try fs.readFileContents(yaml)
4960-
let inputs = """
4961-
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift"))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule"))"
4960+
let inputs: SerializedJSON = """
4961+
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift"))","\(swiftGetVersionFilePath)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule"))"
49624962
"""
4963-
XCTAssertMatch(yamlContents, .contains(inputs))
4963+
XCTAssertMatch(yamlContents, .contains(inputs.underlying))
49644964
}
49654965

49664966
private func sanitizerTest(_ sanitizer: PackageModel.Sanitizer, expectedName: String) throws {

0 commit comments

Comments
 (0)