Skip to main content

featherdb_query/expr/
aggregate.rs

1//! Aggregate function types
2
3/// Built-in aggregate functions
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum AggregateFunction {
6    Count,
7    Sum,
8    Avg,
9    Min,
10    Max,
11}
12
13#[cfg(test)]
14mod tests {
15    use super::*;
16
17    #[test]
18    fn test_aggregate_function_clone() {
19        let agg = AggregateFunction::Count;
20        let cloned = agg.clone();
21        assert_eq!(agg, cloned);
22    }
23
24    #[test]
25    fn test_aggregate_function_debug() {
26        let agg = AggregateFunction::Sum;
27        assert_eq!(format!("{:?}", agg), "Sum");
28    }
29}