From 5cc96a0fb06fa7d86563f4cb64e5fa9d4f6a09f9 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Mon, 13 Nov 2017 01:00:33 -0500 Subject: Big-ass coding binge presents: a Lisp. This implements a continuation-passing interpreter, which means we get tail calls ferfree. I stopped short of implementing call/cc, because I don't think we need it, but we can get there if we have to. --- tests/test_evaluator.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/test_evaluator.py (limited to 'tests/test_evaluator.py') diff --git a/tests/test_evaluator.py b/tests/test_evaluator.py new file mode 100644 index 0000000..d989f85 --- /dev/null +++ b/tests/test_evaluator.py @@ -0,0 +1,18 @@ +from hypothesis import given, event + +from actinide.evaluator import * +from actinide.environment import * +from actinide.types import * + +from .programs import * + +# Cases for the evaluator: + +# * Given a program, does it produce the expected evaluation? +@given(programs()) +def test_evaluator(program_result): + program, result, bindings = program_result + environment = Environment() + assert run(eval(program, environment, symbol_table, None)) == result + for symbol, value in bindings: + assert environment[symbol] == value -- cgit v1.2.3