run strategy tests on analysed AST
Currently, strategies are tested on the original AST, but often you like to run them on the analysed AST. To distinguish both use cases, I would like something like this
Submitted by Guido Wachsmuth on 12 January 2012 at 15:24test addition [[a= [[3 + 3 ]];]] run type-of to Int()
vs.test addition [[a= [[3 + 3 ]];]] analyze and run type-of to Int()
Issue Log
We could also use the meta-data in the
esv
to help here. Normally, only builders that have a(source)
annotation in theesv
work on the source AST.That said, it seems that if you use
run
instead ofbuild
, it uses the source AST instead of the analyzed AST. (And since you’re calling a builder you should probably be callingbuild
anyway.) It was supposed to use the analyzed AST by default. That should be fixed inr24193
.
build
does not help here, becausetype-of
is a simple strategy, not a builder. It does not match the builder-specific tuple. It simply maps desugared expressions to their types.
Fixed in https://github.com/metaborg/spt/commit/11ffdfa7fd5c4961bcce787e9075cc72e393532f
Log in to post comments