@@ -985,10 +985,10 @@ final class WorkspaceTests: XCTestCase {
985
985
" build/compile_commands.json " : """
986
986
[
987
987
{
988
- " directory " : " $TEST_DIR " ,
989
- " command " : " swiftc $TEST_DIR /src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
988
+ " directory " : " $TEST_DIR_BACKSLASH_ESCAPED " ,
989
+ " command " : " swiftc $TEST_DIR_BACKSLASH_ESCAPED /src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
990
990
" file " : " src/Foo.swift " ,
991
- " output " : " $TEST_DIR /build/Foo.swift.o "
991
+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /build/Foo.swift.o "
992
992
}
993
993
]
994
994
""" ,
@@ -1031,10 +1031,10 @@ final class WorkspaceTests: XCTestCase {
1031
1031
" projA/build/compile_commands.json " : """
1032
1032
[
1033
1033
{
1034
- " directory " : " $TEST_DIR /projA " ,
1035
- " command " : " swiftc $TEST_DIR /projA/src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
1034
+ " directory " : " $TEST_DIR_BACKSLASH_ESCAPED /projA " ,
1035
+ " command " : " swiftc $TEST_DIR_BACKSLASH_ESCAPED /projA/src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
1036
1036
" file " : " src/Foo.swift " ,
1037
- " output " : " $TEST_DIR /projA/build/Foo.swift.o "
1037
+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /projA/build/Foo.swift.o "
1038
1038
}
1039
1039
]
1040
1040
""" ,
@@ -1078,10 +1078,10 @@ final class WorkspaceTests: XCTestCase {
1078
1078
" otherbuild/compile_commands.json " : """
1079
1079
[
1080
1080
{
1081
- " directory " : " $TEST_DIR " ,
1082
- " command " : " swiftc $TEST_DIR /src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
1081
+ " directory " : " $TEST_DIR_BACKSLASH_ESCAPED " ,
1082
+ " command " : " swiftc $TEST_DIR_BACKSLASH_ESCAPED /src/Foo.swift -DHAVE_SETTINGS \( defaultSDKArgs) " ,
1083
1083
" file " : " src/Foo.swift " ,
1084
- " output " : " $TEST_DIR /otherbuild/Foo.swift.o "
1084
+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /otherbuild/Foo.swift.o "
1085
1085
}
1086
1086
]
1087
1087
""" ,
@@ -1112,10 +1112,12 @@ final class WorkspaceTests: XCTestCase {
1112
1112
1113
1113
fileprivate let defaultSDKArgs : String = {
1114
1114
if let defaultSDKPath {
1115
- let escapedPath = defaultSDKPath. replacing ( #"\"# , with : #"\\"# )
1115
+ let escapedPath = defaultSDKPath
1116
1116
return """
1117
- -sdk ' \( escapedPath) '
1117
+ -sdk " \( escapedPath) "
1118
1118
"""
1119
+ . replacing ( #"\"# , with: #"\\"# )
1120
+ . replacing ( " \" " , with: #"\""# )
1119
1121
}
1120
1122
return " "
1121
1123
} ( )
0 commit comments