Skip to content

Commit 79e1339

Browse files
committed
testing: skip empty lines in output matching
1 parent 185a880 commit 79e1339

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/JExtractSwiftTests/Asserts/TextAssertions.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ func assertOutput(
131131
line: Int = #line,
132132
column: Int = #column
133133
) {
134-
let gotLines = got.split(separator: "\n")
135-
let expectedLines = expected.split(separator: "\n")
134+
let gotLines = got.split(separator: "\n").filter { l in
135+
l.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).count > 0
136+
}
137+
let expectedLines = expected.split(separator: "\n").filter { l in
138+
l.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).count > 0
139+
}
136140

137141
var diffLineNumbers: [Int] = []
138142

0 commit comments

Comments
 (0)