From 1cbd5f3051ba90b3f673bc2f6319192d05381719 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 10 Dec 2020 22:44:35 +0100 Subject: =?UTF-8?q?Refine=20test=20infrastructure=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tests diagnostics - More and better separated image tests --- src/parse/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/parse/tests.rs') diff --git a/src/parse/tests.rs b/src/parse/tests.rs index 054b2cd9..172b1d15 100644 --- a/src/parse/tests.rs +++ b/src/parse/tests.rs @@ -56,24 +56,31 @@ use Unit::*; fn Id(ident: &str) -> Expr { Expr::Lit(Lit::Ident(Ident(ident.to_string()))) } + fn Bool(b: bool) -> Expr { Expr::Lit(Lit::Bool(b)) } + fn Int(int: i64) -> Expr { Expr::Lit(Lit::Int(int)) } + fn Float(float: f64) -> Expr { Expr::Lit(Lit::Float(float)) } + fn Percent(percent: f64) -> Expr { Expr::Lit(Lit::Percent(percent)) } + fn Length(val: f64, unit: Unit) -> Expr { Expr::Lit(Lit::Length(val, unit)) } + fn Color(color: RgbaColor) -> Expr { Expr::Lit(Lit::Color(color)) } + fn Str(string: &str) -> Expr { Expr::Lit(Lit::Str(string.to_string())) } @@ -98,6 +105,7 @@ fn Unary(op: impl Into>, expr: impl Into>) -> Expr { expr: expr.into().map(Box::new), }) } + fn Binary( op: impl Into>, lhs: impl Into>, -- cgit v1.2.3