File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,9 +79,21 @@ final class BuildTargetSourcesTests: XCTestCase {
7979
8080 XCTAssertEqual ( result. items. count, 1 )
8181 XCTAssertEqual ( result. items [ 0 ] . sources. map ( \. uri) , [ URL ( filePath: filePath) . absoluteString] )
82+ func trimTrailingSlashes( _ path: String ) -> String {
83+ var value = path
84+ while value. count > 1 , value. hasSuffix ( " / " ) {
85+ value. removeLast ( )
86+ }
87+ return value
88+ }
89+
90+ let rootPaths = try result. items [ 0 ] . roots. map { uri -> String in
91+ let url = try XCTUnwrap ( URL ( string: uri) )
92+ return trimTrailingSlashes ( URL ( filePath: url. path ( ) ) . standardizedFileURL. path ( ) )
93+ }
8294 XCTAssertEqual (
83- result . items [ 0 ] . roots ,
84- [ URL ( filePath : " /tmp/Project/Sources " ) . appending ( path : " / " ) . absoluteString ]
95+ rootPaths ,
96+ [ trimTrailingSlashes ( " /tmp/Project/Sources " ) ]
8597 )
8698 }
8799}
You can’t perform that action at this time.
0 commit comments