mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
add integration tests mysql-types.rs/decimal
This commit is contained in:
parent
229635771a
commit
d50405743b
1 changed files with 12 additions and 0 deletions
|
@ -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::<sqlx::types::BigDecimal>().unwrap(),
|
||||
"CAST(10000 AS DECIMAL(5, 0))" == "10000".parse::<sqlx::types::BigDecimal>().unwrap(),
|
||||
"CAST(0.1 AS DECIMAL(2, 1))" == "0.1".parse::<sqlx::types::BigDecimal>().unwrap(),
|
||||
"CAST(0.01234 AS DECIMAL(6, 5))" == "0.01234".parse::<sqlx::types::BigDecimal>().unwrap(),
|
||||
"CAST(12.34 AS DECIMAL(4, 2))" == "12.34".parse::<sqlx::types::BigDecimal>().unwrap(),
|
||||
"CAST(12345.6789 AS DECIMAL(9, 4))" == "12345.6789".parse::<sqlx::types::BigDecimal>().unwrap(),
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue