mirror of https://github.com/AMT-Cheif/drift.git
🚨 Fix lines more than 80 characters + add some other const keywords
This commit is contained in:
parent
26b6fc4203
commit
7134e892c0
|
@ -33,14 +33,18 @@ void main() {
|
|||
.go();
|
||||
|
||||
verify(executor.runDelete(
|
||||
'DELETE FROM users WHERE NOT is_awesome OR id < ?;', [100]));
|
||||
'DELETE FROM users WHERE NOT is_awesome OR id < ?;', const [100]));
|
||||
});
|
||||
|
||||
test('to delete an entity via a dataclasss', () async {
|
||||
await db.delete(db.sharedTodos).delete(const SharedTodo(todo: 3, user: 2));
|
||||
await db
|
||||
.delete(db.sharedTodos)
|
||||
.delete(const SharedTodo(todo: 3, user: 2));
|
||||
|
||||
verify(executor.runDelete(
|
||||
'DELETE FROM shared_todos WHERE todo = ? AND user = ?;', [3, 2]));
|
||||
'DELETE FROM shared_todos WHERE todo = ? AND user = ?;',
|
||||
const [3, 2],
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -75,19 +79,19 @@ void main() {
|
|||
test('delete()', () async {
|
||||
await db.users.delete().go();
|
||||
|
||||
verify(executor.runDelete('DELETE FROM users;', []));
|
||||
verify(executor.runDelete('DELETE FROM users;', const []));
|
||||
});
|
||||
|
||||
test('deleteOne()', () async {
|
||||
await db.users.deleteOne(const UsersCompanion(id: Value(3)));
|
||||
|
||||
verify(executor.runDelete('DELETE FROM users WHERE id = ?;', [3]));
|
||||
verify(executor.runDelete('DELETE FROM users WHERE id = ?;', const [3]));
|
||||
});
|
||||
|
||||
test('deleteWhere', () async {
|
||||
await db.users.deleteWhere((tbl) => tbl.id.isSmallerThanValue(3));
|
||||
|
||||
verify(executor.runDelete('DELETE FROM users WHERE id < ?;', [3]));
|
||||
verify(executor.runDelete('DELETE FROM users WHERE id < ?;', const [3]));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,7 +14,12 @@ void main() {
|
|||
db.select(db.myView).watch(),
|
||||
emitsInOrder([
|
||||
isEmpty,
|
||||
[const MyViewData(configKey: 'another', syncState: SyncType.synchronized)]
|
||||
[
|
||||
const MyViewData(
|
||||
configKey: 'another',
|
||||
syncState: SyncType.synchronized,
|
||||
),
|
||||
]
|
||||
]),
|
||||
);
|
||||
|
||||
|
|
|
@ -171,7 +171,10 @@ void _runTests(FutureOr<DriftIsolate> Function() spawner, bool terminateIsolate,
|
|||
|
||||
await expectLater(stream, emits(null));
|
||||
await database.into(database.todosTable).insert(initialCompanion);
|
||||
await expectLater(stream, emits(const TodoEntry(id: 1, content: 'my content')));
|
||||
await expectLater(
|
||||
stream,
|
||||
emits(const TodoEntry(id: 1, content: 'my content')),
|
||||
);
|
||||
});
|
||||
|
||||
test('can start transactions', () async {
|
||||
|
|
Loading…
Reference in New Issue