()
| 148 | |
| 149 | #[test] |
| 150 | fn test_binary_condition_parser() { |
| 151 | let values = [ |
| 152 | ( |
| 153 | r#"$programming_language == "Rust""#, |
| 154 | BinaryCondition { |
| 155 | left: "programming_language".to_string(), |
| 156 | operator: BinaryConditionOperator::Equality, |
| 157 | right: Value::String("Rust".to_string()), |
| 158 | }, |
| 159 | ), |
| 160 | ( |
| 161 | "$salary >= 1000000", |
| 162 | BinaryCondition { |
| 163 | left: "salary".to_string(), |
| 164 | operator: BinaryConditionOperator::GreaterEqualThan, |
| 165 | right: Value::Int(1000000), |
| 166 | }, |
| 167 | ), |
| 168 | ( |
| 169 | "$age < 18", |
| 170 | BinaryCondition { |
| 171 | left: "age".to_string(), |
| 172 | operator: BinaryConditionOperator::LessThan, |
| 173 | right: Value::Int(18), |
| 174 | }, |
| 175 | ), |
| 176 | ]; |
| 177 | |
| 178 | for (source, expected) in values { |
| 179 | let (_, parsed) = parse_binary_condition(source).unwrap(); |
| 180 | |
| 181 | assert_eq!(parsed, expected); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | #[test] |
| 186 | fn test_logical_operator_parser() { |
nothing calls this directly
no test coverage detected