test_floats/
test_floats.rs1use qail_core::parser::parse;
3use qail_core::transpiler::ToSql;
4
5fn main() {
6 let tests = [
7 ("Simple float", "get stats fields 100.0 as val"),
8 ("Zero float", "get stats fields 0.0 as val"),
9 ("Pi", "get stats fields 3.14 as val"),
10 (
11 "CASE with floats",
12 "get stats fields case when x > 0 then 100.0 else 0.0 end as rate",
13 ),
14 ];
15
16 for (name, test) in tests {
17 println!("{}:", name);
18 match parse(test) {
19 Ok(cmd) => println!(" ✅ {}\n", cmd.to_sql()),
20 Err(e) => println!(" ❌ {}\n", e),
21 }
22 }
23}