File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Plugins/BridgeJS/Tests/BridgeJSToolTests Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,23 @@ func assertSnapshot(
3232 #expect( ok, buildComment ( ) , sourceLocation: sourceLocation)
3333 if !ok {
3434 try input. write ( to: URL ( fileURLWithPath: actualFilePath) )
35+ // Print diff for CI debugging
36+ let expectedLines = existingSnapshot. split ( separator: " \n " , omittingEmptySubsequences: false )
37+ let actualStr = String ( data: input, encoding: . utf8) !
38+ let actualLines = actualStr. split ( separator: " \n " , omittingEmptySubsequences: false )
39+ let maxLines = max ( expectedLines. count, actualLines. count)
40+ for i in 0 ..< maxLines {
41+ let exp = i < expectedLines. count ? String ( expectedLines [ i] ) : " <missing> "
42+ let act = i < actualLines. count ? String ( actualLines [ i] ) : " <missing> "
43+ if exp != act {
44+ print ( " SNAPSHOT DIFF line \( i + 1 ) : " )
45+ print ( " expected: \( exp) " )
46+ print ( " actual: \( act) " )
47+ }
48+ }
49+ if expectedLines. count != actualLines. count {
50+ print ( " SNAPSHOT DIFF line count: expected= \( expectedLines. count) actual= \( actualLines. count) " )
51+ }
3552 }
3653 } else {
3754 try input. write ( to: snapshotPath)
You can’t perform that action at this time.
0 commit comments