From 91b1662302c14cf84ca8b90c1f3ec20a585f67a5 Mon Sep 17 00:00:00 2001 From: dozens Date: Fri, 7 Jun 2024 17:27:11 -0600 Subject: add ui tests --- test/README | 18 ++++++++++++++++++ test/moving-capture.dat | 22 ++++++++++++++++++++++ test/placing-capture.dat | 5 +++++ test/test.awk | 12 ++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 test/README create mode 100644 test/moving-capture.dat create mode 100644 test/placing-capture.dat create mode 100644 test/test.awk (limited to 'test') diff --git a/test/README b/test/README new file mode 100644 index 0000000..11b09a4 --- /dev/null +++ b/test/README @@ -0,0 +1,18 @@ +== ABOUT == + +these files are to help me test the ui + +moves are recorded in `.dat`. +then you can `awk -f test.awk file.dat > file.expect`. +(or `just expects` to build them all.) +then you can `expect file.expect` +to have expect play the game for you up to a certain point. + +== REQUIREMENTS == + +- awk +- expect + +== FUTURE PLANS == + +have actual integration tests? diff --git a/test/moving-capture.dat b/test/moving-capture.dat new file mode 100644 index 0000000..d19ede6 --- /dev/null +++ b/test/moving-capture.dat @@ -0,0 +1,22 @@ +A1 +A4 +A7 +b2 +b4 +b6 +c3 +c4 +c5 +d1 +d2 +d3 +d5 +d6 +d7 +e3 +e4 +e5 +e4f4 +e3e4 +f4g4 +d3e3 diff --git a/test/placing-capture.dat b/test/placing-capture.dat new file mode 100644 index 0000000..67aebec --- /dev/null +++ b/test/placing-capture.dat @@ -0,0 +1,5 @@ +a1 +b4 +a4 +b2 +a7 diff --git a/test/test.awk b/test/test.awk new file mode 100644 index 0000000..ef6df20 --- /dev/null +++ b/test/test.awk @@ -0,0 +1,12 @@ +BEGIN { + print "#!/usr/bin/expect -f" + print "spawn fennel main.fnl" +} + +{ print "expect -re \"Player .'s turn:\"" + print "send -- \"" $0 "\\r\"" +} + +END { + print "interact" +} -- cgit 1.4.1-2-gfad0