semantic
semantic copied to clipboard
Unit test framework for compiled Core programs
The FileCheck-esque testing framework for semantic-python
fixtures has proven versatile. However, it doesn’t offer a pretty fundamental characteristic: the ability to run a compiled program and verify its output. This is because I haven’t needed it up until now: it was sufficient for me to specify exactly what output I expected.
I now want not just to test output but behavior. For example, I need to be able to specify that the program
class Foo(object):
def m(self): “foo”
class Bar(Foo):
def m(self): “bar”
n = Bar().m()
I want to verify that compiling that module and evaluating n
in its context returns a Core triple with class str
and contents ”bar”
.
I don’t have any great ideas on how to do this, but I’m opening this so that I can think about it.