This commit is contained in:
Chris Tsang 2021-10-11 18:50:05 +08:00
parent 1a2bd13158
commit ecaa0dca18

View File

@ -542,15 +542,15 @@ mod tests {
let txn = db.begin().await?; let txn = db.begin().await?;
let mut stream = fruit::Entity::find().stream(&txn).await?; if let Ok(mut stream) = fruit::Entity::find().stream(&txn).await {
assert_eq!(stream.try_next().await?, Some(apple));
assert_eq!(stream.try_next().await?, Some(apple)); assert_eq!(stream.try_next().await?, Some(orange));
assert_eq!(stream.try_next().await?, Some(orange)); assert_eq!(stream.try_next().await?, None);
assert_eq!(stream.try_next().await?, None); // stream will be dropped end of scope OR std::mem::drop(stream);
}
std::mem::drop(stream);
txn.commit().await?; txn.commit().await?;