From 9ee84d6ed811f3c357c9e642dbc6d7ad20fae74f Mon Sep 17 00:00:00 2001 From: Ajax Date: Fri, 13 Jan 2017 17:42:44 +0100 Subject: Expr: test that repr permit instanciation --- test/expression/expression.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/expression/expression.py') diff --git a/test/expression/expression.py b/test/expression/expression.py index 58c0ca37..8e8b5e07 100644 --- a/test/expression/expression.py +++ b/test/expression/expression.py @@ -51,3 +51,17 @@ for expr in [ print "For value %s" % consval.value for constraint in consval.constraints: print "\t%s" % constraint.to_constraint() + +# Repr +for expr in [ + cst1, + A, + ExprMem(cst1, 32), + ExprCond(cond1, cst1, cst2), + A + cst1, + ExprCompose(A, cst1), + A.msb(), + ExprAff(A, cst1), +]: + print repr(expr) + assert expr == eval(repr(expr)) -- cgit 1.4.1