Skip to content

Commit 3c00045

Browse files
committed
Only log failed comparisons
1 parent 282bfb6 commit 3c00045

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/XcodeProjTests/Tests/testWrite.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func testWrite<T: Writable & Equatable>(file _: StaticString = #file,
1212
testWrite(from: path, initModel: initModel, modify: modify, assertion: { XCTAssertEqual($0, $1) })
1313
}
1414

15-
func testWrite<T: Writable>(file: StaticString = #file,
15+
func testWrite<T: Writable & Equatable>(file: StaticString = #file,
1616
line: UInt = #line,
1717
from path: Path,
1818
initModel: (Path) -> T?,
@@ -32,7 +32,9 @@ func testWrite<T: Writable>(file: StaticString = #file,
3232
XCTAssertNotNil(gotAfterWriting, file: file, line: line)
3333
if let gotAfterWriting {
3434
assertion(got, gotAfterWriting)
35-
print("-------\n(\(got)\n\n\n ------- \n\(gotAfterWriting)")
35+
if got != gotAfterWriting {
36+
print("-------\n(\(got)\n\n\n ------- \n\(gotAfterWriting)")
37+
}
3638
}
3739
} catch {
3840
XCTFail("It shouldn't throw an error writing the project: \(error.localizedDescription)", file: file, line: line)

0 commit comments

Comments
 (0)