test runBatched with the default executor

This commit is contained in:
brunobnahorny 2023-11-05 11:07:32 -03:00 committed by Simon Binder
parent 398299e6e3
commit 5426ad8a40
1 changed files with 9 additions and 0 deletions

View File

@ -149,6 +149,15 @@ void main() {
(e) => e.remoteCause, 'remoteCause', 'UnimplementedError: error!')),
);
final statements =
BatchedStatements(['SELECT 1'], [ArgumentsForBatchedStatement(0, [])]);
when(executor.runBatched(any)).thenAnswer((i) => Future.value());
// Not using db.batch because that starts a transaction, we want to test
// this working with the default executor.
// Regression test for: https://github.com/simolus3/drift/pull/2707
await db.executor.runBatched(statements);
verify(executor.runBatched(statements));
await db.close();
});