From 0be16bad16a53821e16555fdf024f86dc672aa9c Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 15 Dec 2022 21:24:18 +0800 Subject: [PATCH] Add tests --- tests/byte_primary_key_tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/byte_primary_key_tests.rs b/tests/byte_primary_key_tests.rs index 0ed5e5a6..01b76850 100644 --- a/tests/byte_primary_key_tests.rs +++ b/tests/byte_primary_key_tests.rs @@ -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 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 explicitly + .into_tuple() + .one(db) + .await?, + Some((vec![1_u8, 2_u8, 3_u8], "First Row (Updated)".to_owned(),)) + ); + Ok(()) }