Skip to content

Commit bd506b7

Browse files
authored
Tests: simplify constant construction (#6461)
Reuse the base path from a local variable reducing the arcs that we append to reduce the amount of duplication and avoid having multiple sites to modify for changes.
1 parent 1828be2 commit bd506b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ final class WorkspaceTests: XCTestCase {
244244
testDiagnostics(observability.diagnostics) { result in
245245
let diagnostic = result.check(
246246
diagnostic: .contains(
247-
"\(path.appending(components: "MyPkg", "Package.swift")):4:8: error: An error in MyPkg"
247+
"\(pkgDir.appending("Package.swift")):4:8: error: An error in MyPkg"
248248
),
249249
severity: .error
250250
)

0 commit comments

Comments
 (0)