typealias PathStruct and add Swift 5.5 niceness

Fixes #55
This commit is contained in:
Max Howell
2021-06-16 11:04:51 -04:00
parent ecbb3a60fe
commit 14f03abaad
5 changed files with 29 additions and 1 deletions

View File

@@ -3,7 +3,20 @@ import func XCTest.XCTAssertEqual
import Foundation
import XCTest
extension PathStruct {
var foo: Int { fatalError()}
}
class PathTests: XCTestCase {
func testNewStuff() {
#if swift(>=5.5)
func foo<P: Pathish>(_ path: P) {}
foo(.home)
foo(.root)
#endif
}
func testConcatenation() {
XCTAssertEqual((Path.root/"bar").string, "/bar")
XCTAssertEqual(Path.cwd.string, FileManager.default.currentDirectoryPath)

View File

@@ -45,6 +45,7 @@ extension PathTests {
("testMktemp", testMktemp),
("testMoveInto", testMoveInto),
("testMoveTo", testMoveTo),
("testNewStuff", testNewStuff),
("testNoUndesiredSymlinkResolution", testNoUndesiredSymlinkResolution),
("testOptionalInitializer", testOptionalInitializer),
("testParent", testParent),