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

Function test_implicit_cast_mixed_arithmetic

tests/implicit_cast_test.rs:196–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195#[test]
196fn test_implicit_cast_mixed_arithmetic() {
197 let conn = setup_test_db();
198
199 // Test: Complex expression with mixed types
200 let sql = "SELECT (quantity * 2 + 5) * price / 100 FROM products";
201 let result = rewrite_query(&conn, sql).unwrap();
202
203 // Debug: print the rewritten query
204 println!("Rewritten mixed arithmetic query: {result}");
205
206 // Should handle type promotion throughout the expression
207 assert!(result.contains("decimal_mul"));
208 assert!(result.contains("decimal_add"));
209 assert!(result.contains("decimal_div"));
210 assert!(result.contains("decimal_from_text"));
211}

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected