From a959451e85ee736e9cd500ba5fc7784546715307 Mon Sep 17 00:00:00 2001 From: James Tomlinson Date: Sat, 29 Aug 2020 00:40:33 +0100 Subject: [PATCH] Add Sqlite Uuid type tests. --- tests/sqlite/types.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/sqlite/types.rs b/tests/sqlite/types.rs index 0d07d2d8..fa248191 100644 --- a/tests/sqlite/types.rs +++ b/tests/sqlite/types.rs @@ -134,3 +134,19 @@ mod git2 { == Oid::from_str("000102030405060708090a0b0c0d0e0f10111213") )); } + +#[cfg(feature = "uuid")] +test_type!(uuid(Sqlite, + "x'b731678f636f4135bc6f19440c13bd19'" + == sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap(), + "x'00000000000000000000000000000000'" + == sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap() +)); + +#[cfg(feature = "uuid")] +test_type!(uuid_hyphenated(Sqlite, + "'b731678f-636f-4135-bc6f-19440c13bd19'" + == sqlx::types::Uuid::parse_str("b731678f-636f-4135-bc6f-19440c13bd19").unwrap().to_hyphenated(), + "'00000000-0000-0000-0000-000000000000'" + == sqlx::types::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap().to_hyphenated() +));