a few comparison tests

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36274 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-03-05 13:42:37 +00:00
parent 8b0e7537b0
commit 5039bf29c9

View file

@ -159,6 +159,25 @@ NSLog(@"'%@', '%@'", NSUserName(), [attr fileOwnerAccountName]);
PASS([mgr changeCurrentDirectoryPath: @"subdir"],
"NSFileManager can move into subdir");
[mgr createDirectoryAtPath: @"sub1" attributes: nil];
[mgr createFileAtPath: @"sub1/x"
contents: [@"hello" dataUsingEncoding: NSASCIIStringEncoding]
attributes: nil],
[mgr createDirectoryAtPath: @"sub2" attributes: nil];
[mgr createFileAtPath: @"sub2/x"
contents: [@"hello" dataUsingEncoding: NSASCIIStringEncoding]
attributes: nil];
PASS(YES == [mgr contentsEqualAtPath: @"sub1/x" andPath: @"sub2/x"],
"directories containing identical files are equal");
[mgr removeFileAtPath: @"sub2/x" handler: nil],
[mgr createFileAtPath: @"sub2/x"
contents: [@"goodbye" dataUsingEncoding: NSASCIIStringEncoding]
attributes: nil];
PASS(NO == [mgr contentsEqualAtPath: @"sub1/x" andPath: @"sub2/x"],
"directories containing files with different content are not equal");
[mgr removeFileAtPath: @"sub1" handler: nil];
[mgr removeFileAtPath: @"sub2" handler: nil];
err = nil;
PASS([mgr createDirectoryAtPath: dirInDir
withIntermediateDirectories: NO
@ -187,7 +206,7 @@ NSLog(@"'%@', '%@'", NSUserName(), [attr fileOwnerAccountName]);
PASS([mgr removeFileAtPath: dir handler: nil],
"NSFileManager removes a directory");
PASS(![mgr fileExistsAtPath: dir],"directory no longer exists");
}
}
err = nil;
PASS([mgr createDirectoryAtURL: [NSURL fileURLWithPath:dirInDir]