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

Function test_float_aggregates

tests/float_decimal_test.rs:119–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117
118#[test]
119fn test_float_aggregates() {
120 let conn = setup_test_db();
121
122 // Test aggregate functions on float columns
123 let sql = "SELECT AVG(temperature), MAX(pressure), MIN(humidity) FROM measurements";
124 let result = rewrite_query(&conn, sql).unwrap();
125 println!("Float aggregates rewritten to: {result}");
126 assert!(result.contains("AVG"));
127 assert!(result.contains("MAX"));
128 assert!(result.contains("MIN"));
129 // The arguments should be used directly without wrapping since they're already DECIMAL
130 assert!(!result.contains("decimal_from_text(temperature)"));
131 assert!(!result.contains("decimal_from_text(pressure)"));
132 assert!(!result.contains("decimal_from_text(humidity)"));
133}
134
135#[test]
136fn test_float_in_subquery() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected