()
| 109 | |
| 110 | #[tokio::test] |
| 111 | async fn test_decimal_comparisons() { |
| 112 | let ctx = setup_test_db().await; |
| 113 | |
| 114 | // Insert test data |
| 115 | ctx.execute( |
| 116 | "INSERT INTO accounts (name, balance, credit_limit) VALUES |
| 117 | ('Test1', '100.00', '500.00'), |
| 118 | ('Test2', '200.00', '1000.00'), |
| 119 | ('Test3', '300.00', '1500.00')" |
| 120 | ).await.unwrap(); |
| 121 | |
| 122 | // Test equality - use string comparison for exact decimal matches |
| 123 | let result = ctx.query("SELECT * FROM accounts WHERE balance = '200.00'").await.unwrap(); |
| 124 | assert_eq!(result.rows.len(), 1); |
| 125 | |
| 126 | // Test less than - use CAST to REAL for proper numeric comparison |
| 127 | let result = ctx.query("SELECT * FROM accounts WHERE CAST(balance AS REAL) < 250").await.unwrap(); |
| 128 | assert_eq!(result.rows.len(), 2); |
| 129 | |
| 130 | // Test greater than - use CAST to REAL for proper numeric comparison |
| 131 | let result = ctx.query("SELECT * FROM accounts WHERE CAST(credit_limit AS REAL) > 750").await.unwrap(); |
| 132 | assert_eq!(result.rows.len(), 2); |
| 133 | } |
| 134 | |
| 135 | #[tokio::test] |
| 136 | async fn test_decimal_aggregates() { |
nothing calls this directly
no test coverage detected