test: formatter: check for round-trip through parser
This commit is contained in:
parent
e8ca2e3f62
commit
6a8048fb97
1 changed files with 6 additions and 3 deletions
|
|
@ -16,9 +16,12 @@ discard $ liftM $ MetaHasEval.eval env opts do
|
|||
stx' ← liftMetaM stx' $ PrettyPrinter.parenthesizeTerm stx';
|
||||
f' ← liftMetaM stx' $ PrettyPrinter.formatTerm table stx';
|
||||
dbgTrace $ toString f';
|
||||
e' ← elabTermAndSynthesize stx' none <* throwErrorIfErrors;
|
||||
unlessM (isDefEq stx e e') $
|
||||
throwError stx (fmt "failed to elab round-trip" ++ line ++ fmt e ++ line ++ fmt e')
|
||||
match Parser.runParserCategory env `term (toString f') "<input>" with
|
||||
| Except.error e => throwError stx e
|
||||
| Except.ok stx'' => do
|
||||
e' ← elabTermAndSynthesize stx'' none <* throwErrorIfErrors;
|
||||
unlessM (isDefEq stx e e') $
|
||||
throwError stx (fmt "failed to round-trip" ++ line ++ fmt e ++ line ++ fmt e')
|
||||
|
||||
-- #eval check `(?m) -- fails round-trip
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue