From d50405743b9663dcd55cc4a66d3ec9d42b0e0b23 Mon Sep 17 00:00:00 2001 From: xiaopengli89 Date: Wed, 8 Apr 2020 15:29:15 +0800 Subject: [PATCH] add integration tests mysql-types.rs/decimal --- tests/mysql-types.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/mysql-types.rs b/tests/mysql-types.rs index 1b88eafc..45af828d 100644 --- a/tests/mysql-types.rs +++ b/tests/mysql-types.rs @@ -123,3 +123,15 @@ mod time_tests { .assume_utc() )); } + +#[cfg(feature = "bigdecimal")] +test_type!(decimal( + MySql, + sqlx::types::BigDecimal, + "CAST(1 AS DECIMAL(1, 0))" == "1".parse::().unwrap(), + "CAST(10000 AS DECIMAL(5, 0))" == "10000".parse::().unwrap(), + "CAST(0.1 AS DECIMAL(2, 1))" == "0.1".parse::().unwrap(), + "CAST(0.01234 AS DECIMAL(6, 5))" == "0.01234".parse::().unwrap(), + "CAST(12.34 AS DECIMAL(4, 2))" == "12.34".parse::().unwrap(), + "CAST(12345.6789 AS DECIMAL(9, 4))" == "12345.6789".parse::().unwrap(), +));