summaryrefslogtreecommitdiff
path: root/examples/turing_machine/test_turing_machine.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/turing_machine/test_turing_machine.py')
-rw-r--r--examples/turing_machine/test_turing_machine.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/turing_machine/test_turing_machine.py b/examples/turing_machine/test_turing_machine.py
new file mode 100644
index 0000000..bf2f9d2
--- /dev/null
+++ b/examples/turing_machine/test_turing_machine.py
@@ -0,0 +1,14 @@
+"""Integration test using turing_machine.py"""
+# pylint: disable=pointless-statement,import-error
+from external.bazel_python.pytest_helper import main
+import turing_machine
+
+def test_turing_machine():
+ """Regression test for the Turing machine example."""
+ ts = turing_machine.Main()
+ state, tape, index = turing_machine.PrintTMState(ts)
+ assert state == "/:State:B"
+ assert tape == ["/:Symbol:1", "X"]
+ assert index == 1
+
+main(__name__, __file__)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback