MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_update_with_decimal_operations

Function test_update_with_decimal_operations

tests/decimal_integration_test.rs:192–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190
191#[tokio::test]
192async fn test_update_with_decimal_operations() {
193 let ctx = setup_test_db().await;
194
195 // Insert test data
196 ctx.execute(
197 "INSERT INTO accounts (name, balance, credit_limit) VALUES
198 ('Test', '1000.00', '5000.00')"
199 ).await.unwrap();
200
201 // Update with arithmetic
202 let result = ctx.execute(
203 "UPDATE accounts SET balance = balance * 1.1 WHERE name = 'Test'"
204 ).await.unwrap();
205
206 assert_eq!(result.rows_affected, 1);
207
208 // Verify the update
209 let result = ctx.query("SELECT balance FROM accounts WHERE name = 'Test'").await.unwrap();
210 assert_eq!(result.rows.len(), 1);
211 // Balance should be 1100.00 (stored as decimal)
212}
213
214#[tokio::test]
215async fn test_insert_select_with_decimal() {

Callers

nothing calls this directly

Calls 3

setup_test_dbFunction · 0.70
executeMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected