Skip to content

Commit 786e2f1

Browse files
committed
Test that shows a leak.
1 parent aec554a commit 786e2f1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Firestore/Example/Tests/Integration/API/FIRFirestoreSourceTests.mm

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ - (void)testGetCollectionWhileOnlineWithDefaultSource {
6969
]));
7070
}
7171

72+
- (void)testGetDocumentError {
73+
FIRDocumentReference *doc = [self.db documentWithPath:@"foo/__invalid__"];
74+
75+
XCTestExpectation *completed = [self expectationWithDescription:@"get completed"];
76+
[doc getDocumentWithCompletion:^(FIRDocumentSnapshot *snapshot, NSError *error) {
77+
XCTAssertNotNil(error);
78+
[completed fulfill];
79+
}];
80+
81+
[self awaitExpectations];
82+
}
83+
84+
- (void)testGetCollectionError {
85+
FIRCollectionReference *col = [self.db collectionWithPath:@"__invalid__"];
86+
87+
XCTestExpectation *completed = [self expectationWithDescription:@"get completed"];
88+
[col getDocumentsWithCompletion:^(FIRQuerySnapshot *snapshot, NSError *error) {
89+
XCTAssertNotNil(error);
90+
[completed fulfill];
91+
}];
92+
93+
[self awaitExpectations];
94+
}
95+
7296
- (void)testGetDocumentWhileOfflineWithDefaultSource {
7397
FIRDocumentReference *doc = [self documentRef];
7498

0 commit comments

Comments
 (0)