From 5426ad8a40e22259d5d9975b97659c72fd5d37d4 Mon Sep 17 00:00:00 2001 From: brunobnahorny Date: Sun, 5 Nov 2023 11:07:32 -0300 Subject: [PATCH] test runBatched with the default executor --- drift/test/remote_test.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drift/test/remote_test.dart b/drift/test/remote_test.dart index fba747e5..d9845fc4 100644 --- a/drift/test/remote_test.dart +++ b/drift/test/remote_test.dart @@ -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(); });