Skip to content

Commit dcd8d14

Browse files
committed
Added some comments explaining the tests
1 parent 326d350 commit dcd8d14

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Tests/PARStoreBlobTests.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ - (NSString *)deviceIdentifierForTest
3838

3939
- (void)testDeletion
4040
{
41+
// deleting a blob with the old API should work as before
42+
4143
NSError *error = nil;
4244
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
4345
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];
@@ -61,6 +63,7 @@ - (void)testDeletion
6163

6264
- (void)testDeletionWithTombstone
6365
{
66+
// deleting a blob with the new API should result in a tombstone file
6467
NSError *error = nil;
6568
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
6669
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];
@@ -85,6 +88,8 @@ - (void)testDeletionWithTombstone
8588

8689
- (void)testBlobExists
8790
{
91+
// exists should product the right result before/after creation of a blob file
92+
8893
NSError *error = nil;
8994
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
9095
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];
@@ -99,6 +104,9 @@ - (void)testBlobExists
99104

100105
- (void)testTombstoneSuppressesFileExistence
101106
{
107+
// if there's a tombstone file present, exists should return NO even if the actual blob
108+
// file is still present
109+
102110
NSError *error = nil;
103111
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
104112
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];
@@ -117,6 +125,9 @@ - (void)testTombstoneSuppressesFileExistence
117125

118126
- (void)testTombstoneSuppressesData
119127
{
128+
// if there is a tombstone file present, no data should be returned even if the actual blob
129+
// file is still present
130+
120131
NSError *error = nil;
121132
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
122133
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];
@@ -134,6 +145,9 @@ - (void)testTombstoneSuppressesData
134145

135146
- (void)testTombstoneSuppressesEnumeration
136147
{
148+
// tombstone files shoulnd't be included in the enumeration
149+
// the presence of a tombstone file should also cause the corresponding data file to be skipped
150+
// from the enumeration (if it still exists)
137151
NSError *error = nil;
138152
NSURL *url = [[self urlWithUniqueTmpDirectory] URLByAppendingPathComponent:@"doc.parstore"];
139153
PARStore *store = [PARStore storeWithURL:url deviceIdentifier:[self deviceIdentifierForTest]];

0 commit comments

Comments
 (0)