From 4f261b734685f478c3a065e232158143a9694765 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 18 Dec 2020 21:56:50 -0800 Subject: [PATCH] test: added an explicit cast for bstr test where sqlite failed to do an implicit cast --- tests/sqlite/types.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/sqlite/types.rs b/tests/sqlite/types.rs index fa248191..7d8b8c20 100644 --- a/tests/sqlite/types.rs +++ b/tests/sqlite/types.rs @@ -112,10 +112,9 @@ mod bstr { use super::*; use sqlx::types::bstr::BString; - test_type!(BString(Sqlite, "'abc123'" == BString::from(b"abc123"))); - test_type!(BString( - Sqlite, - "x'0001020304'" == BString::from(b"\x00\x01\x02\x03\x04") + test_type!(bstring(Sqlite, + "cast('abc123' as blob)" == BString::from(&b"abc123"[..]), + "x'0001020304'" == BString::from(&b"\x00\x01\x02\x03\x04"[..]) )); } @@ -124,14 +123,11 @@ mod git2 { use super::*; use sqlx::types::git2::Oid; - test_type!(Oid( - Sqlite, - "x'0000000000000000000000000000000000000000'" == Oid::zero() - )); - test_type!(Oid( + test_type!(oid( Sqlite, + "x'0000000000000000000000000000000000000000'" == Oid::zero(), "x'000102030405060708090a0b0c0d0e0f10111213'" - == Oid::from_str("000102030405060708090a0b0c0d0e0f10111213") + == Oid::from_str("000102030405060708090a0b0c0d0e0f10111213").unwrap() )); }