summaryrefslogtreecommitdiff
path: root/src/parse/tests.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-12-10 22:44:35 +0100
committerLaurenz <laurmaedje@gmail.com>2020-12-10 22:45:45 +0100
commit1cbd5f3051ba90b3f673bc2f6319192d05381719 (patch)
tree182134e9f355062a00a145fab3a988847c4ed13b /src/parse/tests.rs
parentfdc1b378a3eb3cf325592b801c43e2ec2478ddff (diff)
Refine test infrastructure ✅
- Tests diagnostics - More and better separated image tests
Diffstat (limited to 'src/parse/tests.rs')
-rw-r--r--src/parse/tests.rs8
1 files changed, 8 insertions, 0 deletions
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<Spanned<UnOp>>, expr: impl Into<Spanned<Expr>>) -> Expr {
expr: expr.into().map(Box::new),
})
}
+
fn Binary(
op: impl Into<Spanned<BinOp>>,
lhs: impl Into<Spanned<Expr>>,