From 038a6f2d30a6ebfc10d9c41f7bf218b2f7db288c Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 11 Mar 2020 01:54:46 -0700 Subject: [PATCH] Fix tests for MySQL chrono --- sqlx-core/src/mysql/types/chrono.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlx-core/src/mysql/types/chrono.rs b/sqlx-core/src/mysql/types/chrono.rs index 4b9a59c2..03fdc56f 100644 --- a/sqlx-core/src/mysql/types/chrono.rs +++ b/sqlx-core/src/mysql/types/chrono.rs @@ -260,15 +260,15 @@ fn test_encode_date_time() { fn test_decode_date_time() { // test values from https://dev.mysql.com/doc/internals/en/binary-protocol-value.html let buf = [11, 218, 7, 10, 17, 19, 27, 30, 1, 0, 0, 0]; - let date1 = >::decode(&buf).unwrap(); + let date1 = >::decode(Some(MySqlValue::Binary(&buf))).unwrap(); assert_eq!(date1.to_string(), "2010-10-17 19:27:30.000001"); let buf = [7, 218, 7, 10, 17, 19, 27, 30]; - let date2 = >::decode(&buf).unwrap(); + let date2 = >::decode(Some(MySqlValue::Binary(&buf))).unwrap(); assert_eq!(date2.to_string(), "2010-10-17 19:27:30"); let buf = [4, 218, 7, 10, 17]; - let date3 = >::decode(&buf).unwrap(); + let date3 = >::decode(Some(MySqlValue::Binary(&buf))).unwrap(); assert_eq!(date3.to_string(), "2010-10-17 00:00:00"); } @@ -283,6 +283,6 @@ fn test_encode_date() { #[test] fn test_decode_date() { let buf = [4, 218, 7, 10, 17]; - let date = >::decode(&buf).unwrap(); + let date = >::decode(Some(MySqlValue::Binary(&buf))).unwrap(); assert_eq!(date.to_string(), "2010-10-17"); }