Skip to content

Commit 581c3fe

Browse files
authored
Merge pull request #862 from owenv/owenv/loosen-asert
Make assembleSingleFile resilient to output changes
2 parents 1fc05a2 + 85d8ace commit 581c3fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SWBBuildSystemTests/BuildCommandTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
220220
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
221221
try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", #require(outputs.first)])
222222
let assembly = try String(contentsOfFile: #require(outputs.first), encoding: .utf8)
223-
#expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions"))
223+
#expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions"))
224224
}
225225
results.checkNoTask()
226226
}
@@ -232,7 +232,7 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
232232
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
233233
try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", #require(outputs.first)])
234234
let assembly = try String(contentsOfFile: #require(outputs.first), encoding: .utf8)
235-
#expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions"))
235+
#expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions"))
236236
}
237237
results.checkNoTask()
238238
}
@@ -246,13 +246,13 @@ fileprivate struct BuildCommandTests: CoreBasedTests {
246246
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
247247
try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", firstOutput])
248248
let assembly = try String(contentsOfFile: firstOutput, encoding: .utf8)
249-
#expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions"))
249+
#expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions"))
250250
}
251251
try results.checkTask(.matchRuleType("Assemble"), .matchRuleItemBasename("File.m"), .matchRuleItem("normal"), .matchRuleItem(results.runDestinationTargetArchitecture), .matchTargetName("bFramework")) { task in
252252
task.checkCommandLineContainsUninterrupted(["-x", "objective-c"])
253253
try task.checkCommandLineContainsUninterrupted(["-S", #require(inputs.first).str, "-o", secondOutput])
254254
let assembly = try String(contentsOfFile: secondOutput, encoding: .utf8)
255-
#expect(assembly.hasPrefix("\t.section\t__TEXT,__text,regular,pure_instructions"))
255+
#expect(assembly.contains("\t.section\t__TEXT,__text,regular,pure_instructions"))
256256
}
257257
results.checkNoTask()
258258
results.checkNoErrors()

0 commit comments

Comments
 (0)