@@ -22,7 +22,7 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
22
22
///
23
23
/// Ensure that a round-trip fails when the minor version number changes
24
24
func testSerializedVersionChangeDetection( ) throws {
25
- let mockPath = VirtualPath . absolute ( AbsolutePath ( " /module-dependency-graph " ) )
25
+ let mockPath = try VirtualPath . absolute ( AbsolutePath ( validating : " /module-dependency-graph " ) )
26
26
let fs = InMemoryFileSystem ( )
27
27
let graph = Self . mockGraphCreator. mockUpAGraph ( )
28
28
let currentVersion = ModuleDependencyGraph . serializedGraphVersion
@@ -37,7 +37,7 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
37
37
try graph. write (
38
38
to: mockPath,
39
39
on: fs,
40
- buildRecord: info ,
40
+ buildRecord: graph . buildRecord ,
41
41
mockSerializedGraphVersion: alteredVersion)
42
42
}
43
43
@@ -60,7 +60,7 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
60
60
}
61
61
62
62
func roundTrip( _ originalGraph: ModuleDependencyGraph ) throws {
63
- let mockPath = VirtualPath . absolute ( AbsolutePath ( " /module-dependency-graph " ) )
63
+ let mockPath = try VirtualPath . absolute ( AbsolutePath ( validating : " /module-dependency-graph " ) )
64
64
let fs = InMemoryFileSystem ( )
65
65
let outputFileMap = OutputFileMap . mock ( maxIndex: Self . maxIndex)
66
66
let diagnosticsEngine = DiagnosticsEngine ( )
@@ -69,13 +69,14 @@ class DependencyGraphSerializationTests: XCTestCase, ModuleDependencyGraphMocker
69
69
outputFileMap: outputFileMap,
70
70
compilerVersion: " Swift 99 " )
71
71
try originalGraph. blockingConcurrentMutation {
72
- try originalGraph. write ( to: mockPath, on: fs, buildRecord: buildRecord)
72
+ try originalGraph. write (
73
+ to: mockPath, on: fs,
74
+ buildRecord: originalGraph. buildRecord)
73
75
}
74
76
75
77
let info = IncrementalCompilationState . IncrementalDependencyAndInputSetup. mock ( outputFileMap: outputFileMap, fileSystem: fs)
76
- let deserializedGraph = try info. blockingConcurrentAccessOrMutation {
77
- try ModuleDependencyGraph . read ( from: mockPath,
78
- info: info) !
78
+ let deserializedGraph = try info. blockingConcurrentAccessOrMutation {
79
+ try XCTUnwrap ( ModuleDependencyGraph . read ( from: mockPath, info: info) )
79
80
}
80
81
81
82
let descsToCompare = [ originalGraph, deserializedGraph] . map {
0 commit comments