Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Tests/Foundation/Tests/TestNSString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1019,21 +1019,22 @@ class TestNSString: LoopbackServerTest {
do {
let path: NSString = "~"
let result = path.expandingTildeInPath
XCTAssert(result == NSHomeDirectory(), "Could resolve home directory for current user")
XCTAssertEqual(result, NSHomeDirectory(), "Could resolve home directory for current user")
XCTAssertFalse(result.hasSuffix("/") && result != rootDirectory, "Result should not have a trailing path separator")
}

do {
let path: NSString = "~/"
let result = path.expandingTildeInPath
XCTAssert(result == NSHomeDirectory(), "Could resolve home directory for current user")
XCTAssertEqual(result, NSHomeDirectory(), "Could resolve home directory for current user")
XCTAssertFalse(result.hasSuffix("/") && result != rootDirectory, "Result should not have a trailing path separator")
}

do {
let path = NSString(string: "~\(NSUserName())")
let result = path.expandingTildeInPath
XCTAssert(result == NSHomeDirectory(), "Could resolve home directory for specific user")
XCTAssertEqual(result, NSHomeDirectory(),
"Could resolve home directory for specific user")
XCTAssertFalse(result.hasSuffix("/") && result != rootDirectory, "Result should not have a trailing path separator")
}

Expand Down