#![allow(clippy::unwrap_used)]
#![allow(clippy::expect_used)]
use crate::mysql::SqlValue;
#[test]
fn test_from_u64_top_half_no_truncation() {
let small: SqlValue = 42u64.into();
assert!(matches!(small, SqlValue::Int(42)));
let max_i64: SqlValue = (i64::MAX as u64).into();
assert!(matches!(max_i64, SqlValue::Int(v) if v == i64::MAX));
let over: SqlValue = (i64::MAX as u64 + 1).into();
match over {
SqlValue::String(s) => assert_eq!(s, "9223372036854775808"),
other => panic!("u64 顶半区应转为 String,实得 {:?}", other),
}
let umax: SqlValue = u64::MAX.into();
match umax {
SqlValue::String(s) => assert_eq!(s, u64::MAX.to_string()),
other => panic!("u64::MAX 应转为 String,实得 {:?}", other),
}
}