From 29c0cdaf3fbdf8d285b5c1fddbff06d5ff93a2f5 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 14 Sep 2019 16:48:51 +0200 Subject: [PATCH] Write integration test for Dart templates --- .../parsed_sql/moor_files_integration_test.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/moor/test/parsed_sql/moor_files_integration_test.dart b/moor/test/parsed_sql/moor_files_integration_test.dart index 4ea88f04..a10a460b 100644 --- a/moor/test/parsed_sql/moor_files_integration_test.dart +++ b/moor/test/parsed_sql/moor_files_integration_test.dart @@ -54,4 +54,17 @@ void main() { await db.into(db.mytable).insert(const MytableCompanion()); verify(mock.runInsert('INSERT INTO mytable DEFAULT VALUES', [])); }); + + test('runs queries with arrays and Dart templates', () async { + final mock = MockExecutor(); + final db = CustomTablesDb(mock); + + await db.readMultiple(['a', 'b'], + OrderBy([OrderingTerm(expression: db.config.configKey)])).get(); + + verify(mock.runSelect( + 'SELECT * FROM config WHERE config_key IN (?1, ?2) ORDER BY config_key ASC', + ['a', 'b'], + )); + }); }