Skip to content

Commit bcf15e3

Browse files
authored
Replace remaining uses of <<< operator with .send (#1451)
After merging #1444 there are still a few uses of `<<<` left, which should be cleaned up. This fixes remaining deprecation warnings caused by the use of `<<<`.
1 parent e864a4e commit bcf15e3

File tree

3 files changed

+18
-27
lines changed

3 files changed

+18
-27
lines changed

Tests/SwiftDriverTests/CachingBuildTests.swift

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ final class CachingBuildTests: XCTestCase {
148148
try withTemporaryDirectory { path in
149149
let main = path.appending(component: "testCachingBuildJobs.swift")
150150
try localFileSystem.writeFileContents(main) {
151-
$0 <<< "import C;"
152-
$0 <<< "import E;"
153-
$0 <<< "import G;"
151+
$0.send("import C;import E;import G;")
154152
}
155153
let casPath = path.appending(component: "cas")
156154
let swiftModuleInterfacesPath: AbsolutePath =
@@ -278,9 +276,7 @@ final class CachingBuildTests: XCTestCase {
278276
try withTemporaryDirectory { path in
279277
let main = path.appending(component: "testExplicitModuleVerifyInterfaceJobs.swift")
280278
try localFileSystem.writeFileContents(main) {
281-
$0 <<< "import C;"
282-
$0 <<< "import E;"
283-
$0 <<< "import G;"
279+
$0.send("import C;import E;import G;")
284280
}
285281

286282
let swiftModuleInterfacesPath: AbsolutePath =
@@ -427,9 +423,7 @@ final class CachingBuildTests: XCTestCase {
427423
try localFileSystem.createDirectory(moduleCachePath)
428424
let main = path.appending(component: "testCachingBuild.swift")
429425
try localFileSystem.writeFileContents(main) {
430-
$0 <<< "import C;"
431-
$0 <<< "import E;"
432-
$0 <<< "import G;"
426+
$0.send("import C;import E;import G;")
433427
}
434428

435429
let cHeadersPath: AbsolutePath =
@@ -477,17 +471,17 @@ final class CachingBuildTests: XCTestCase {
477471
let foo = path.appending(component: "foo.swift")
478472
let casPath = path.appending(component: "cas")
479473
try localFileSystem.writeFileContents(foo) {
480-
$0 <<< "extension Profiler {"
481-
$0 <<< " public static let count: Int = 42"
482-
$0 <<< "}"
474+
$0.send("extension Profiler {")
475+
$0.send(" public static let count: Int = 42")
476+
$0.send("}")
483477
}
484478
let fooHeader = path.appending(component: "foo.h")
485479
try localFileSystem.writeFileContents(fooHeader) {
486-
$0 <<< "struct Profiler { void* ptr; };"
480+
$0.send("struct Profiler { void* ptr; };")
487481
}
488482
let main = path.appending(component: "main.swift")
489483
try localFileSystem.writeFileContents(main) {
490-
$0 <<< "import Foo"
484+
$0.send("import Foo")
491485
}
492486
let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
493487

@@ -546,9 +540,7 @@ final class CachingBuildTests: XCTestCase {
546540
try withTemporaryDirectory { path in
547541
let main = path.appending(component: "testDependencyScanning.swift")
548542
try localFileSystem.writeFileContents(main) {
549-
$0 <<< "import C;"
550-
$0 <<< "import E;"
551-
$0 <<< "import G;"
543+
$0.send("import C;import E;import G;")
552544
}
553545

554546
let cHeadersPath: AbsolutePath =

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
362362
try withTemporaryDirectory { path in
363363
let main = path.appending(component: "testExplicitModuleVerifyInterfaceJobs.swift")
364364
try localFileSystem.writeFileContents(main) {
365-
$0 <<< "import C;"
366-
$0 <<< "import E;"
367-
$0 <<< "import G;"
365+
$0.send("import C;import E;import G;")
368366
}
369367

370368
let swiftModuleInterfacesPath: AbsolutePath =
@@ -1029,17 +1027,17 @@ final class ExplicitModuleBuildTests: XCTestCase {
10291027
try localFileSystem.createDirectory(FooInstallPath)
10301028
let foo = path.appending(component: "foo.swift")
10311029
try localFileSystem.writeFileContents(foo) {
1032-
$0 <<< "extension Profiler {"
1033-
$0 <<< " public static let count: Int = 42"
1034-
$0 <<< "}"
1030+
$0.send("extension Profiler {")
1031+
$0.send(" public static let count: Int = 42")
1032+
$0.send("}")
10351033
}
10361034
let fooHeader = path.appending(component: "foo.h")
10371035
try localFileSystem.writeFileContents(fooHeader) {
1038-
$0 <<< "struct Profiler { void* ptr; };"
1036+
$0.send("struct Profiler { void* ptr; };")
10391037
}
10401038
let main = path.appending(component: "main.swift")
10411039
try localFileSystem.writeFileContents(main) {
1042-
$0 <<< "import Foo"
1040+
$0.send("import Foo")
10431041
}
10441042
let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
10451043

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,8 +2200,9 @@ final class SwiftDriverTests: XCTestCase {
22002200

22012201
do {
22022202
try withTemporaryDirectory { path in
2203-
try localFileSystem.writeFileContents(
2204-
path.appending(components: "wasi", "static-executable-args.lnk")) { $0 <<< "garbage" }
2203+
try localFileSystem.writeFileContents(path.appending(components: "wasi", "static-executable-args.lnk")) {
2204+
$0.send("garbage")
2205+
}
22052206
// Wasm executable linking
22062207
var driver = try Driver(args: commonArgs + ["-emit-executable", "-Ounchecked",
22072208
"-target", "wasm32-unknown-wasi",

0 commit comments

Comments
 (0)