@@ -713,22 +713,22 @@ void testDatabase(
713
713
});
714
714
715
715
test ('emits on rollback' , () {
716
- expect (database.rollbacks, emits (isA < void >() ));
716
+ expect (database.rollbacks, emits (anything ));
717
717
718
718
database.execute ('BEGIN TRANSACTION;' );
719
719
database.execute ("ROLLBACK;" );
720
720
});
721
721
722
722
test ('emits on rollback after insert' , () {
723
- expect (database.rollbacks, emits (isA < void >() ));
723
+ expect (database.rollbacks, emits (anything ));
724
724
725
725
database.execute ('BEGIN TRANSACTION;' );
726
726
database.execute ("INSERT INTO tbl VALUES ('', 1);" );
727
727
database.execute ("ROLLBACK;" );
728
728
});
729
729
730
730
test ('emits on rollback after erroneous SQL' , () {
731
- expect (database.rollbacks, emits (isA < void >() ));
731
+ expect (database.rollbacks, emits (anything ));
732
732
733
733
database.execute ('BEGIN TRANSACTION;' );
734
734
try {
@@ -740,7 +740,7 @@ void testDatabase(
740
740
});
741
741
742
742
test ('emits on rollback due to commit filter' , () {
743
- expect (database.rollbacks, emits (isA < void >() ));
743
+ expect (database.rollbacks, emits (anything ));
744
744
database.commitFilter = expectAsync0 (() => false );
745
745
746
746
database.execute ('begin' );
@@ -815,30 +815,30 @@ void testDatabase(
815
815
});
816
816
817
817
test ('emits on implicit commit' , () {
818
- expect (database.commits, emits (isA < void >() ));
818
+ expect (database.commits, emits (anything ));
819
819
database.execute ("INSERT INTO tbl VALUES ('', 1);" );
820
820
});
821
821
822
822
test ('emits on explicit commit' , () {
823
- expect (database.commits, emits (isA < void >() ));
823
+ expect (database.commits, emits (anything ));
824
824
825
825
database.execute ('BEGIN TRANSACTION;' );
826
826
database.execute ("INSERT INTO tbl VALUES ('', 1);" );
827
827
database.execute ("COMMIT;" );
828
828
});
829
829
830
830
test ('does not emit on implicit commit with commitFilter false' , () async {
831
- final future = expectLater (
832
- database.commits
833
- .timeout (Duration (seconds: 2 ), onTimeout: (sink) => sink.close ()),
834
- neverEmits (isA <void >()));
831
+ expect (database.commits, neverEmits (anything));
835
832
database.commitFilter = () => false ;
836
833
try {
837
834
database.execute ("INSERT INTO tbl VALUES ('', 1);" );
838
835
} on SqliteException {
839
836
// ignore
840
837
}
841
- await future;
838
+
839
+ // Disposing the database here so that the stream closes and neverEmits
840
+ // completes.
841
+ database.dispose ();
842
842
});
843
843
});
844
844
0 commit comments