difftreelog
test(parser) merge new tests
in: master
3 files changed
.gitignorediffbeforeafterboth1/target1/target23.idea4.vscode25.rustfmt.tomldiffbeforeafterbothno changes
crates/jsonnet-parser/src/lib.rsdiffbeforeafterboth241pub mod tests {241pub mod tests {242 use super::{expr::*, parse};242 use super::{expr::*, parse};243244 mod expressions {245 use super::*;246247 pub fn basic_math() -> Expr {248 Expr::BinaryOp(249 Box::new(Expr::Num(2.0)),250 BinaryOpType::Add,251 Box::new(Expr::BinaryOp(252 Box::new(Expr::Num(2.0)),253 BinaryOpType::Mul,254 Box::new(Expr::Num(2.0)),255 )),256 )257 }258 }259243 #[test]260 #[test]244 fn empty_object() {261 fn empty_object() {260 );278 );261 }279 }280281 #[test]282 fn basic_math_with_indents() {283 assert_eq!(parse("2 + 2 * 2 ").unwrap(), expressions::basic_math());284 }285286 #[test]287 fn basic_math_parened() {288 assert_eq!(289 parse("2+(2+2*2)").unwrap(),290 Expr::BinaryOp(291 Box::new(Expr::Num(2.0)),292 BinaryOpType::Add,293 Box::new(Expr::Parened(Box::new(expressions::basic_math()))),294 )295 );296 }262297263 /// Comments should not affect parsing298 /// Comments should not affect parsing264 #[test]299 #[test]