From 7e087c23047a352609f4b9b2302304f0e8dab713 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 20 Jan 2023 07:51:38 -0800 Subject: [PATCH] Tests: convert assertions in test_expandingTildeInPath to XCTAssertEqual Use `XCTAssertEqual` to assert equality to make it easier to diagnose and repair failures in the test suite. --- Tests/Foundation/Tests/TestNSString.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/Foundation/Tests/TestNSString.swift b/Tests/Foundation/Tests/TestNSString.swift index f86945a795..3339815b3e 100644 --- a/Tests/Foundation/Tests/TestNSString.swift +++ b/Tests/Foundation/Tests/TestNSString.swift @@ -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") }