@@ -985,10 +985,10 @@ final class WorkspaceTests: XCTestCase {
985985 " build/compile_commands.json " : """
986986 [
987987 {
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) " ,
990990 " file " : " src/Foo.swift " ,
991- " output " : " $TEST_DIR /build/Foo.swift.o "
991+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /build/Foo.swift.o "
992992 }
993993 ]
994994 """ ,
@@ -1031,10 +1031,10 @@ final class WorkspaceTests: XCTestCase {
10311031 " projA/build/compile_commands.json " : """
10321032 [
10331033 {
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) " ,
10361036 " file " : " src/Foo.swift " ,
1037- " output " : " $TEST_DIR /projA/build/Foo.swift.o "
1037+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /projA/build/Foo.swift.o "
10381038 }
10391039 ]
10401040 """ ,
@@ -1078,10 +1078,10 @@ final class WorkspaceTests: XCTestCase {
10781078 " otherbuild/compile_commands.json " : """
10791079 [
10801080 {
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) " ,
10831083 " file " : " src/Foo.swift " ,
1084- " output " : " $TEST_DIR /otherbuild/Foo.swift.o "
1084+ " output " : " $TEST_DIR_BACKSLASH_ESCAPED /otherbuild/Foo.swift.o "
10851085 }
10861086 ]
10871087 """ ,
@@ -1112,10 +1112,12 @@ final class WorkspaceTests: XCTestCase {
11121112
11131113fileprivate let defaultSDKArgs : String = {
11141114 if let defaultSDKPath {
1115- let escapedPath = defaultSDKPath. replacing ( #"\"# , with : #"\\"# )
1115+ let escapedPath = defaultSDKPath
11161116 return """
1117- -sdk ' \( escapedPath) '
1117+ -sdk " \( escapedPath) "
11181118 """
1119+ . replacing ( #"\"# , with: #"\\"# )
1120+ . replacing ( " \" " , with: #"\""# )
11191121 }
11201122 return " "
11211123} ( )
0 commit comments