about summary refs log tree commit diff stats
path: root/chessboard.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-27 00:10:20 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-27 00:10:20 -0700
commit5b1219ca1967d0602542a8f31f3e889837c63087 (patch)
treeb39276a08ba620cc1a826ba3f986612fae921c94 /chessboard.mu
parent9109a91690e0ba2f8e094a9f92eabdae40b82481 (diff)
downloadmu-5b1219ca1967d0602542a8f31f3e889837c63087.tar.gz
2870 - fix the final long-standing failing test
The solution for avoiding deadlock is for routines to close channels
before they exit. So that's good.

Once I implemented 'close', I also found and fixed 2 unrelated bugs in
chessboard.mu:
  a) one long-missed and long-masked case of forgetting to store
  character literals in character variables
  b) one typo in translating get-address to put
So that's good.

What's not so good: in the process of fixing this I've found three
unrelated bugs (marked 'BUG:' in the changes). All three have
workarounds, so existing tests pass for now. But they are my top
priority next.
Diffstat (limited to 'chessboard.mu')
-rw-r--r--chessboard.mu6
1 files changed, 4 insertions, 2 deletions
diff --git a/chessboard.mu b/chessboard.mu
index 0e13afce..3d6b93e2 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -35,7 +35,8 @@ scenario print-board-and-read-move [
   run [
     screen:address:screen, console:address:console <- chessboard screen:address:screen, console:address:console
     # icon for the cursor
-    screen <- print screen, 9251/␣
+    1:character/cursor-icon <- copy 9251/␣
+    screen <- print screen, 1:character/cursor-icon
   ]
   screen-should-contain [
   #            1         2         3         4         5         6         7         8         9         10        11
@@ -255,9 +256,10 @@ def read-move stdin:address:source:character, screen:address:screen -> result:ad
   to-rank:number, quit?, error? <- read-rank stdin, screen
   return-if quit?, 0/dummy
   return-if error?, 0/dummy
-  *result <- put *result, to-rank:offset, to-file
+  *result <- put *result, to-rank:offset, to-rank
   error? <- expect-from-channel stdin, 10/newline, screen
   return-if error?, 0/dummy, 0/quit
+  return result  # BUG: why is this statement required?
 ]
 
 # valid values for file: 0-7