Skip to content

Commit 19d75e8

Browse files
committed
Test: Update test expectcation to be more flexible
A test recently started failing as the expected output now contains a file path. Update the impacted test to be more robust to such a change as SwiftPM does not generate this output.
1 parent 022a6d0 commit 19d75e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/BuildTests/BuildSystemDelegateTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ struct BuildSystemDelegateTests {
4545
"log didn't contain expected linker diagnostics. stderr: '\(stderr)')",
4646
)
4747
case .swiftbuild:
48+
let searchPathRegex = try Regex("warning:(.*)Search path 'foobar' not found")
4849
#expect(
49-
stderr.contains("warning: Search path 'foobar' not found"),
50+
stderr.contains(searchPathRegex),
5051
"log didn't contain expected linker diagnostics. stderr: '\(stdout)",
5152
)
5253
#expect(
53-
!stdout.contains("warning: Search path 'foobar' not found"),
54+
!stdout.contains(searchPathRegex),
5455
"log didn't contain expected linker diagnostics. stderr: '\(stderr)')",
5556
)
5657
case .xcode:

0 commit comments

Comments
 (0)