From 86754e05376db6e1c7bf6e435b034a984c311d0d Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 14 Apr 2015 01:47:01 -0400 Subject: [PATCH] Adding another test case for empty directories --- Tests/SUBinaryDeltaTest.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/SUBinaryDeltaTest.m b/Tests/SUBinaryDeltaTest.m index 3b5e536c..8ef55ae4 100644 --- a/Tests/SUBinaryDeltaTest.m +++ b/Tests/SUBinaryDeltaTest.m @@ -107,6 +107,20 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec }]; } +- (void)testDifferentlyNamedEmptyDataDiff +{ + [self createAndApplyPatchWithHandler:^(NSFileManager *__unused fileManager, NSString *sourceDirectory, NSString *destinationDirectory) { + NSData *emptyData = [NSData data]; + NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"]; + NSString *destinationFile = [destinationDirectory stringByAppendingPathComponent:@"B"]; + + XCTAssertTrue([emptyData writeToFile:sourceFile atomically:YES]); + XCTAssertTrue([emptyData writeToFile:destinationFile atomically:YES]); + + XCTAssertFalse([self testDirectoryHashEqualityWithSource:sourceDirectory destination:destinationDirectory]); + }]; +} + - (void)testEmptyDirectoryDiff { [self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {