Commit 780ee01
authored
Fixes warnings in SwiftTestingRunner.swift (#1565)
Fixes #1557.
Before:
```sh
> bazel build //tools/test_observer
INFO: Analyzed target //tools/test_observer:test_observer (0 packages loaded, 0 targets configured).
INFO: From Compiling Swift module //tools/test_observer:test_observer:
tools/test_observer/SwiftTestingRunner.swift:83:26: warning: result of call to 'withLock' is unused
81 | switch testOrSuite {
82 | case .suite(let suiteID):
83 | discoveredSuites.withLock { $0.insert(suiteID) }
| `- warning: result of call to 'withLock' is unused
84 | case .test(let test):
85 | collector.addTest(test)
tools/test_observer/SwiftTestingRunner.swift:179:34: warning: trailing closure in this context is confusable with the body of the statement; pass as a parenthesized argument to silence this warning
177 | case .string(let testID) = payload["testID"],
178 | // Ignore suites. The xUnit recorder reconstructs the hierarchy.
179 | !discoveredSuites.withLock { $0.contains(testID) },
| `- warning: trailing closure in this context is confusable with the body of the statement; pass as a parenthesized argument to silence this warning
180 | case .object(let instantJSON) = payload["instant"],
181 | case .number(let absolute) = instantJSON["absolute"]
INFO: Found 1 target...
Target //tools/test_observer:test_observer up-to-date:
bazel-bin/tools/test_observer/BazelTestObservation.swiftdoc
bazel-bin/tools/test_observer/BazelTestObservation.swiftmodule
bazel-bin/tools/test_observer/libtest_observer.a
INFO: Elapsed time: 4.960s, Critical Path: 4.85s
INFO: 3 processes: 1 internal, 1 darwin-sandbox, 1 worker.
INFO: Build completed successfully, 3 total actions
```
After:
```sh
> bazel build //tools/test_observer
INFO: Analyzed target //tools/test_observer:test_observer (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tools/test_observer:test_observer up-to-date:
bazel-bin/tools/test_observer/BazelTestObservation.swiftdoc
bazel-bin/tools/test_observer/BazelTestObservation.swiftmodule
bazel-bin/tools/test_observer/libtest_observer.a
INFO: Elapsed time: 0.115s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
```1 parent 3932bc7 commit 780ee01
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments