diff --git a/Tests/PathTests/PathTests.swift b/Tests/PathTests/PathTests.swift index 2378492..48ba0d0 100644 --- a/Tests/PathTests/PathTests.swift +++ b/Tests/PathTests/PathTests.swift @@ -653,6 +653,12 @@ class PathTests: XCTestCase { XCTAssertEqual(bar.type, .symlink) } } + + func testOptionalInitializer() throws { + XCTAssertNil(Path("")) + XCTAssertNil(Path("./foo")) + XCTAssertEqual(Path("/foo"), Path.root.foo) + } } private func XCTAssertEqual(_ p: P, _ q: Q, file: StaticString = #file, line: UInt = #line) { diff --git a/Tests/PathTests/XCTestManifests.swift b/Tests/PathTests/XCTestManifests.swift index b7c5513..76bc2cb 100644 --- a/Tests/PathTests/XCTestManifests.swift +++ b/Tests/PathTests/XCTestManifests.swift @@ -46,6 +46,7 @@ extension PathTests { ("testMoveInto", testMoveInto), ("testMoveTo", testMoveTo), ("testNoUndesiredSymlinkResolution", testNoUndesiredSymlinkResolution), + ("testOptionalInitializer", testOptionalInitializer), ("testPathComponents", testPathComponents), ("testReadlinkOnFileReturnsSelf", testReadlinkOnFileReturnsSelf), ("testReadlinkOnNonExistantFileThrows", testReadlinkOnNonExistantFileThrows),