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

Function test_aggregate_functions

tests/decimal_rewriter_test.rs:136–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135#[test]
136fn test_aggregate_functions() {
137 let conn = setup_test_db();
138
139 // SUM
140 let sql = "SELECT SUM(price) FROM products";
141 let result = rewrite_query(&conn, sql).unwrap();
142 assert!(result.contains("SUM"));
143 // Note: Aggregate function rewriting may not be implemented yet
144 // assert!(result.contains("decimal_from_text"));
145
146 // AVG
147 let sql = "SELECT AVG(amount) FROM transactions";
148 let result = rewrite_query(&conn, sql).unwrap();
149 assert!(result.contains("AVG"));
150 // Note: Aggregate function rewriting may not be implemented yet
151 // assert!(result.contains("decimal_from_text"));
152
153 // MIN/MAX
154 let sql = "SELECT MIN(price), MAX(price) FROM products";
155 let result = rewrite_query(&conn, sql).unwrap();
156 assert!(result.contains("MIN"));
157 assert!(result.contains("MAX"));
158 // Note: Aggregate function rewriting may not be implemented yet
159 // assert!(result.contains("decimal_from_text"));
160}
161
162#[test]
163fn test_complex_expressions() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected