Skip to content

Commit 2125e93

Browse files
Test store remains open until last reference is closed.
1 parent d29baac commit 2125e93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

objectbox/test/basics_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ void main() {
7070

7171
final id = store1.box<TestEntity>().put(TestEntity(tString: 'foo'));
7272
expect(id, 1);
73+
// Close original store to test store remains open until all refs closed.
74+
store1.close();
75+
expect(true, Store.isOpen('testdata-basics'));
7376
final read = store2.box<TestEntity>().get(id);
7477
expect(read, isNotNull);
7578
expect(read!.tString, 'foo');
7679
store2.close();
80+
expect(false, Store.isOpen('testdata-basics'));
7781
env.closeAndDelete();
7882
});
7983

0 commit comments

Comments
 (0)