File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1078,13 +1078,15 @@ class TestFileManager : XCTestCase {
1078
1078
let srcFile = tmpDir. appendingPathComponent ( " file1.txt " )
1079
1079
let destFile = tmpDir. appendingPathComponent ( " file2.txt " )
1080
1080
1081
+ let source = " This is the source file "
1081
1082
try ? fm. removeItem ( at: srcFile)
1082
- try " This is the source file " . write ( toFile: srcFile. path, atomically: false , encoding: . utf8)
1083
+ try source. write ( toFile: srcFile. path, atomically: false , encoding: . utf8)
1083
1084
1084
1085
func testCopy( ) throws {
1085
1086
try ? fm. removeItem ( at: destFile)
1086
1087
try fm. copyItem ( at: srcFile, to: destFile)
1087
-
1088
+ let copy = try String ( contentsOf: destFile)
1089
+ XCTAssertEqual ( source, copy)
1088
1090
if let srcPerms = ( try fm. attributesOfItem ( atPath: srcFile. path) [ . posixPermissions] as? NSNumber ) ? . intValue,
1089
1091
let destPerms = ( try fm. attributesOfItem ( atPath: destFile. path) [ . posixPermissions] as? NSNumber ) ? . intValue {
1090
1092
XCTAssertEqual ( srcPerms, destPerms)
You can’t perform that action at this time.
0 commit comments