()
| 80 | |
| 81 | #[tokio::test] |
| 82 | async fn test_decimal_arithmetic_execution() { |
| 83 | let ctx = setup_test_db().await; |
| 84 | |
| 85 | // Insert test data |
| 86 | ctx.execute( |
| 87 | "INSERT INTO accounts (name, balance, credit_limit) VALUES |
| 88 | ('Alice', '1000.50', '5000.00'), |
| 89 | ('Bob', '2500.75', '10000.00')" |
| 90 | ).await.unwrap(); |
| 91 | |
| 92 | // Test addition - should use decimal_add |
| 93 | let result = ctx.query("SELECT balance + 100 FROM accounts").await.unwrap(); |
| 94 | assert_eq!(result.rows.len(), 2); |
| 95 | // The result should be decimal calculations |
| 96 | |
| 97 | // Test subtraction |
| 98 | let result = ctx.query("SELECT credit_limit - balance FROM accounts").await.unwrap(); |
| 99 | assert_eq!(result.rows.len(), 2); |
| 100 | |
| 101 | // Test multiplication |
| 102 | let result = ctx.query("SELECT balance * 1.05 FROM accounts").await.unwrap(); |
| 103 | assert_eq!(result.rows.len(), 2); |
| 104 | |
| 105 | // Test division |
| 106 | let result = ctx.query("SELECT balance / 2 FROM accounts").await.unwrap(); |
| 107 | assert_eq!(result.rows.len(), 2); |
| 108 | } |
| 109 | |
| 110 | #[tokio::test] |
| 111 | async fn test_decimal_comparisons() { |
nothing calls this directly
no test coverage detected