difftreelog
test(parser) move duplicate part of tests to submodule
in: master
1 file changed
crates/jsonnet-parser/src/lib.rsdiffbeforeafterboth188pub mod tests {188pub mod tests {189 use super::{expr::*, parse};189 use super::{expr::*, parse};190191 mod expressions {192 use super::*;190193191 fn basic_math_expression() -> Expr {194 pub fn basic_math() -> Expr {192 Expr::BinaryOp(195 Expr::BinaryOp(193 Box::new(Expr::Num(2.0)),196 Box::new(Expr::Num(2.0)),194 BinaryOp::Add,197 BinaryOp::Add,199 )),202 )),200 )203 )201 }204 }205 }202206203 #[test]207 #[test]204 fn empty_object() {208 fn empty_object() {223227224 #[test]228 #[test]225 fn basic_math_with_indents() {229 fn basic_math_with_indents() {226 assert_eq!(parse("2 + 2 * 2 ").unwrap(), basic_math_expression());230 assert_eq!(parse("2 + 2 * 2 ").unwrap(), expressions::basic_math());227 }231 }228232229 #[test]233 #[test]233 Expr::BinaryOp(237 Expr::BinaryOp(234 Box::new(Expr::Num(2.0)),238 Box::new(Expr::Num(2.0)),235 BinaryOp::Add,239 BinaryOp::Add,236 Box::new(Expr::Parened(Box::new(basic_math_expression()))),240 Box::new(Expr::Parened(Box::new(expressions::basic_math()))),237 )241 )238 );242 );239 }243 }