Another tests for streams and migrations

This commit is contained in:
Simon Binder 2020-11-09 18:24:30 +01:00
parent cc464c46d6
commit c6a6c9ac5a
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 4 additions and 2 deletions

View File

@ -151,7 +151,7 @@ void main() {
db.markTablesUpdated({categories}); db.markTablesUpdated({categories});
}); });
test('updates when any queried table changes', () { test('updates when any queried table changes in transaction', () {
// Nonsense query, repro for https://github.com/simolus3/moor/issues/910 // Nonsense query, repro for https://github.com/simolus3/moor/issues/910
final a = db.users; final a = db.users;
final b = db.categories; final b = db.categories;
@ -167,8 +167,10 @@ void main() {
final stream = query.watch(); final stream = query.watch();
expectLater(stream, emitsInOrder([[], []])); expectLater(stream, emitsInOrder([[], []]));
return db.transaction(() async {
db.markTablesUpdated({b}); db.markTablesUpdated({b});
}); });
});
test('setting where multiple times forms conjunction', () async { test('setting where multiple times forms conjunction', () async {
final todos = db.alias(db.todosTable, 't'); final todos = db.alias(db.todosTable, 't');