test: added an explicit cast for bstr test where sqlite failed to do an implicit cast

This commit is contained in:
Ryan Leckey 2020-12-18 21:56:50 -08:00
parent 4ee1727ba6
commit 4f261b7346
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9

View File

@ -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<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<Oid>(
Sqlite,
"x'0000000000000000000000000000000000000000'" == Oid::zero(),
"x'000102030405060708090a0b0c0d0e0f10111213'"
== Oid::from_str("000102030405060708090a0b0c0d0e0f10111213")
== Oid::from_str("000102030405060708090a0b0c0d0e0f10111213").unwrap()
));
}