Skip to content

Commit 3443ad8

Browse files
committed
Test that commits stream is async
1 parent 8a0b75d commit 3443ad8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sqlite3/test/common/database.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,16 @@ void testDatabase(
883883
database.execute("COMMIT;");
884884
});
885885

886+
test('is async', () async {
887+
var commits = 0;
888+
database.commits.listen((_) => commits++);
889+
890+
database.execute("INSERT INTO tbl VALUES ('', 1);");
891+
expect(commits, 0);
892+
await pumpEventQueue();
893+
expect(commits, 1);
894+
});
895+
886896
test('does not emit on implicit commit with commitFilter false', () async {
887897
expect(database.commits, neverEmits(anything));
888898
database.commitFilter = () => false;

0 commit comments

Comments
 (0)