@@ -627,6 +627,27 @@ final class SwiftDriverTests: XCTestCase {
627
627
XCTAssertFalse ( plannedJobs [ 2 ] . commandLine. contains ( . flag( " -emit-dependencies-path " ) ) )
628
628
XCTAssertFalse ( plannedJobs [ 2 ] . commandLine. contains ( . flag( " -serialize-diagnostics-path " ) ) )
629
629
}
630
+
631
+ func testReferenceDependencies( ) throws {
632
+ var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " -incremental " ] )
633
+ let plannedJobs = try driver. planBuild ( )
634
+ XCTAssertTrue ( plannedJobs [ 0 ] . kind == . compile)
635
+ XCTAssertTrue ( plannedJobs [ 0 ] . commandLine. contains ( . flag( " -emit-reference-dependencies-path " ) ) )
636
+ }
637
+
638
+ func testDuplicateName( ) throws {
639
+ assertDiagnostics { diagnosticsEngine, verify in
640
+ _ = try ? Driver ( args: [ " swiftc " , " -c " , " foo.swift " , " foo.swift " ] , diagnosticsEngine: diagnosticsEngine)
641
+ verify. expect ( . error( " filename \" foo.swift \" used twice: 'foo.swift' and 'foo.swift' " ) )
642
+ verify. expect ( . note( " filenames are used to distinguish private declarations with the same name " ) )
643
+ }
644
+
645
+ assertDiagnostics { diagnosticsEngine, verify in
646
+ _ = try ? Driver ( args: [ " swiftc " , " -c " , " foo.swift " , " foo/foo.swift " ] , diagnosticsEngine: diagnosticsEngine)
647
+ verify. expect ( . error( " filename \" foo.swift \" used twice: 'foo.swift' and 'foo/foo.swift' " ) )
648
+ verify. expect ( . note( " filenames are used to distinguish private declarations with the same name " ) )
649
+ }
650
+ }
630
651
631
652
func testOutputFileMapStoring( ) throws {
632
653
// Create sample OutputFileMap:
0 commit comments