File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 102
102
103
103
switch outpath {
104
104
case let outpath? where outpath. hasSuffix ( " .xcodeproj " ) :
105
- // if user specified path ending with .xcodeproj, generate that
106
- " \( packageName) .xcodeproj "
105
+ // if user specified path ending with .xcodeproj, use that
107
106
projectName = String ( outpath. basename. characters. dropLast ( 10 ) )
108
107
dstdir = outpath. parentDirectory
109
108
case let outpath? :
Original file line number Diff line number Diff line change @@ -131,7 +131,8 @@ extension RelativePathTests {
131
131
( " testAbsolute " , testAbsolute) ,
132
132
( " testRelative " , testRelative) ,
133
133
( " testMixed " , testMixed) ,
134
- ( " testRelativeCommonSubprefix " , testRelativeCommonSubprefix)
134
+ ( " testRelativeCommonSubprefix " , testRelativeCommonSubprefix) ,
135
+ ( " testCombiningRelativePaths " , testCombiningRelativePaths)
135
136
]
136
137
}
137
138
}
Original file line number Diff line number Diff line change @@ -216,4 +216,10 @@ class RelativePathTests: XCTestCase {
216
216
XCTAssertEqual ( " ../4/5 " , Path ( " /1/2/4/5 " ) . relative ( to: " /1/2/3 " ) )
217
217
XCTAssertEqual ( " ../../../4/5 " , Path ( " /1/2/4/5 " ) . relative ( to: " /1/2/3/6/7 " ) )
218
218
}
219
+
220
+ func testCombiningRelativePaths( ) {
221
+ XCTAssertEqual ( " /1/2/3 " , Path . join ( " /1/2/4 " , " ../3 " ) . normpath)
222
+ XCTAssertEqual ( " /1/2 " , Path . join ( " /1/2/3 " , " .. " ) . normpath)
223
+ XCTAssertEqual ( " 2 " , Path . join ( " 2/3 " , " .. " ) . normpath)
224
+ }
219
225
}
You can’t perform that action at this time.
0 commit comments