Add tests

This commit is contained in:
Billy Chan 2022-12-15 21:24:18 +08:00
parent 70c4a3a23e
commit 0be16bad16
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7

View File

@ -76,5 +76,23 @@ pub async fn create_and_update(db: &DatabaseConnection) -> Result<(), DbErr> {
})
);
assert_eq!(
Entity::find()
.filter(Column::Id.eq(vec![1_u8, 2_u8, 3_u8])) // annotate it as Vec<u8> explicitly
.into_values::<_, Column>()
.one(db)
.await?,
Some((vec![1_u8, 2_u8, 3_u8], "First Row (Updated)".to_owned(),))
);
assert_eq!(
Entity::find()
.filter(Column::Id.eq(vec![1_u8, 2_u8, 3_u8])) // annotate it as Vec<u8> explicitly
.into_tuple()
.one(db)
.await?,
Some((vec![1_u8, 2_u8, 3_u8], "First Row (Updated)".to_owned(),))
);
Ok(())
}