digego / extempore

A cyber-physical programming environment
1.41k stars 127 forks source link

Remove double evaluation #383

Closed pdcawley closed 4 years ago

pdcawley commented 4 years ago

If the function under tests returns a self-evaluating value, all is fine, but something like:

(xtmtest-result (list 1 2 3) '(1 2 3)) 

falls over in a heap because (1 2 3) doesn't evaluate to anything meaningful. There appear to be other double evaluation issues in play, but if I change them all, 'tests/all.xtm' starts failing; I think because there's some fun going on with the interaction between the evaluation environment and the current environment.

It seems that for really good test separation, it might make sense to do something like:

(let ((test-environment
       (eval '(let () (current-environment)) (interaction-environment))))
  ...)

Which should prevent bindings leaking from one test to the next

benswift commented 4 years ago

Yeah, there could indeed be some weird environment-level interactions in play. I'll have a look when I get a chance. But this is good for now---thanks.