()
| 134 | |
| 135 | #[tokio::test] |
| 136 | async fn test_decimal_aggregates() { |
| 137 | let ctx = setup_test_db().await; |
| 138 | |
| 139 | // Insert test data |
| 140 | ctx.execute( |
| 141 | "INSERT INTO transactions (account_id, amount, fee, type) VALUES |
| 142 | (1, '100.00', '2.50', 'deposit'), |
| 143 | (1, '50.25', '1.25', 'deposit'), |
| 144 | (1, '75.50', '1.50', 'withdrawal'), |
| 145 | (2, '200.00', '5.00', 'deposit')" |
| 146 | ).await.unwrap(); |
| 147 | |
| 148 | // Test SUM |
| 149 | let result = ctx.query("SELECT SUM(amount) FROM transactions WHERE account_id = 1").await.unwrap(); |
| 150 | assert_eq!(result.rows.len(), 1); |
| 151 | |
| 152 | // Test AVG |
| 153 | let result = ctx.query("SELECT AVG(fee) FROM transactions").await.unwrap(); |
| 154 | assert_eq!(result.rows.len(), 1); |
| 155 | |
| 156 | // Test MIN/MAX |
| 157 | let result = ctx.query("SELECT MIN(amount), MAX(amount) FROM transactions").await.unwrap(); |
| 158 | assert_eq!(result.rows.len(), 1); |
| 159 | } |
| 160 | |
| 161 | #[tokio::test] |
| 162 | async fn test_complex_decimal_queries() { |
nothing calls this directly
no test coverage detected