New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: special case deserialisation on Windows #6980
Conversation
@swift-ci please test |
let inputs: SerializedJSON = """ | ||
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift"))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule"))" | ||
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift")._nativePathString(escaped: false))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule")._nativePathString(escaped: false))" | ||
""" | ||
XCTAssertMatch(yamlContents, .contains(inputs.underlying)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If inputs
type is changed to plain String
, that will use string interpolation of AbsolutePath
that calls _nativePathString(escaped: false)
automatically.
let inputs: SerializedJSON = """ | |
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift"))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule"))" | |
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift")._nativePathString(escaped: false))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule")._nativePathString(escaped: false))" | |
""" | |
XCTAssertMatch(yamlContents, .contains(inputs.underlying)) | |
let inputs = """ | |
inputs: ["\(AbsolutePath("/Pkg/Snippets/ASnippet.swift"))","\(swiftGetVersionFilePath.escapedPathString)","\(AbsolutePath("/Pkg/.build/debug/Lib.swiftmodule"))" | |
""" | |
XCTAssertMatch(yamlContents, .contains(inputs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@swift-ci please test |
@swift-ci test windows |
The content being compared here is the actual file content which is apparently not escaped. This matches the expectations by explicitly converting the string form of the path rather than the default which escapes it.
@swift-ci please test |
@swift-ci please test Windows platform |
The content being compared here is the actual file content which is apparently not escaped. This matches the expectations by explicitly converting the string form of the path rather than the default which escapes it.