From fb5db48c529e6861f1ade712fce7d847d5b31420 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Tue, 17 Mar 2020 19:42:23 -0700 Subject: [PATCH] Don't test custom records until we have some kind of fixtures --- tests/postgres-derives.rs | 58 ++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/tests/postgres-derives.rs b/tests/postgres-derives.rs index 7c81ecf5..11689b1b 100644 --- a/tests/postgres-derives.rs +++ b/tests/postgres-derives.rs @@ -28,14 +28,15 @@ enum Strong { Three, } +// TODO: Figure out a good solution for custom type testing // Records must map to a custom type // Note that all types are types in Postgres -#[derive(PartialEq, Debug, sqlx::Type)] -#[sqlx(postgres(oid = 12184))] -struct PgConfig { - name: String, - setting: Option, -} +// #[derive(PartialEq, Debug, sqlx::Type)] +// #[sqlx(postgres(oid = 12184))] +// struct PgConfig { +// name: String, +// setting: Option, +// } test_type!(transparent( Postgres, @@ -60,25 +61,26 @@ test_type!(strong_enum( "'four'::text" == Strong::Three )); -test_type!(record_pg_config( - Postgres, - PgConfig, - // (CC,gcc) - "(SELECT ROW('CC', 'gcc')::pg_config)" - == PgConfig { - name: "CC".to_owned(), - setting: Some("gcc".to_owned()), - }, - // (CC,) - "(SELECT '(\"CC\",)'::pg_config)" - == PgConfig { - name: "CC".to_owned(), - setting: None, - }, - // (CC,"") - "(SELECT '(\"CC\",\"\")'::pg_config)" - == PgConfig { - name: "CC".to_owned(), - setting: Some("".to_owned()), - } -)); +// TODO: Figure out a good solution for custom type testing +// test_type!(record_pg_config( +// Postgres, +// PgConfig, +// // (CC,gcc) +// "(SELECT ROW('CC', 'gcc')::pg_config)" +// == PgConfig { +// name: "CC".to_owned(), +// setting: Some("gcc".to_owned()), +// }, +// // (CC,) +// "(SELECT '(\"CC\",)'::pg_config)" +// == PgConfig { +// name: "CC".to_owned(), +// setting: None, +// }, +// // (CC,"") +// "(SELECT '(\"CC\",\"\")'::pg_config)" +// == PgConfig { +// name: "CC".to_owned(), +// setting: Some("".to_owned()), +// } +// ));