summary refs log tree commit diff stats
path: root/test
Commit message (Expand)AuthorAgeFilesLines
* Merge branch 'master' into previewhut2010-10-082-5/+5
|\
| * a little restructurationhut2010-10-022-5/+5
| * Revert 5 commits concerning utf (due to very poor performance)hut2010-09-301-2/+5
| * ext.utfwidth: updated algorithmshut2010-09-301-5/+0
| * ext.utfwidth: stuffhut2010-09-301-0/+2
* | Merge branch 'stable' into previewhut2010-10-0521-12/+268
|\|
| * removed test/__init__.py (not needed)hut2010-08-291-0/+0
| * defaults.keys: key pL to create relative symlinkshut2010-08-291-0/+47
| * Removed symlink in test/hut2010-08-2919-8/+108
| * Changed implementation of container.historyhut2010-08-281-8/+8
| * Fixed historyhut2010-08-261-0/+19
| * tc_human_readable: additional testcase (which fails)hut2010-06-251-0/+4
| * ext.human_readable: more efficient implementationhut2010-06-242-0/+86
* | Merge branch 'master' into previewhut2010-06-221-9/+8
|\|
| * all_benchmarks: shortenedhut2010-06-181-9/+8
* | Merge branch 'master' into previewhut2010-06-0919-86/+121
|\|
| * all_benchmarks.py: fix + cleanuphut2010-06-091-40/+35
| * all_tests.py: cleanuphut2010-06-091-14/+14
| * Changed hashbang line to "#!/usr/bin/env python"hut2010-06-092-2/+2
| * simplified all_tests.py, moved to test/hut2010-06-0719-86/+126
* | gui.ansi: some modifications/completionshut2010-06-031-7/+2
* | added gui/ansi.py from David Barnetts branchhut2010-06-031-0/+45
|/
* Merge branch 'utf'hut2010-05-171-0/+42
|\
| * fixed utf stuffhut2010-05-171-3/+3
| * attempt to fix utf issues (wrong calculation of width)hut2010-05-101-0/+42
* | fsobject.fsobject: applied patcheshut2010-05-141-0/+1
|/
* all_benchmarks: improvedhut2010-05-101-2/+0
* fsobject: don't unnecessarily use abspath() in __init__hut2010-05-061-1/+2
* cleanupshut2010-05-052-3/+6
* Added license header to a few fileshut2010-05-041-0/+15
* bm_loader: stuffhut2010-05-031-1/+35
* test: added TODO, skip broken testshut2010-05-034-5/+25
* changed testdir to /usr/includehut2010-04-291-1/+1
* Separated benchmark from testcasehut2010-04-293-125/+134
* Added tc_loaderhut2010-04-262-1/+186
* tc_displayable: improved (but not fixed) test_boundarieshut2010-04-181-6/+8
* tc_displayable: test_boundaries fails if you run it more often!hut2010-04-181-20/+21
* Fixed unittestshut2010-04-183-3/+5
* moved container.keymap.KeyBuffer into seperate modulehut2010-04-161-0/+1
* keymap: moved simulate_press to where it belongs: tc_newkeyshut2010-04-161-5/+14
* keymap: move translate_keys to ranger.ext.keybinding_parserhut2010-04-161-2/+3
* dirarg: added unit test and almost working implementaitonhut2010-04-131-0/+7
* tc_newkeys: fixed all but one testhut2010-04-091-6/+24
* partially fix tc_newkeyshut2010-04-091-26/+28
* tc_direction: fixedhut2010-04-081-1/+1
* tc_newkey: added 2 failing test cases. Fix it!hut2010-04-081-13/+53
* clean uphut2010-04-081-1/+2
* added KeyManagerhut2010-04-072-2/+39
* tc_newkey: added commenthut2010-04-071-0/+1
* container.keymap: support for Alt keyhut2010-04-071-0/+2
="n">value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (c:character <- copy ((#\a literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (c:character <- copy ((#\4 literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (c:character <- copy ((#\newline literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (sleep until-routine-done:literal r:integer/routine) ) (each routine completed-routines* ;? (prn " " routine) (awhen rep.routine!error (prn "error - " it))) (when (~ran-to-completion 'read-move) (prn "F - chessboard accepts legal moves (<rank><file>-<rank><file>)")) ; todo: we can't test that keys pressed are printed to screen ; but that's at a lower level ;? (quit) (reset2) (new-trace "read-move-incomplete") ; initialize some variables at specific raw locations ;? (prn "== init") (run-code test-init (1:channel-address/raw <- init-channel 1:literal) (2:terminal-address/raw <- init-fake-terminal 20:literal 10:literal) (3:string-address/raw <- get 2:terminal-address/raw/deref data:offset)) (wipe completed-routines*) ; the component under test; we'll be running this repeatedly (let read-move-routine (make-routine 'read-move memory*.1 memory*.2) ;? (prn "== first key") (run-code send-first-key (default-space:space-address <- new space:literal 30:literal/capacity) (c:character <- copy ((#\a literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value)) (wipe completed-routines*) ; check that read-move consumes it and then goes to sleep (enq read-move-routine running-routines*) (run-more) (when (ran-to-completion 'read-move) (prn "F - chessboard waits after first letter of move")) (wipe completed-routines*) ; send in a few more letters ;? (prn "== more keys") (restart read-move-routine) (run-code send-more-keys (default-space:space-address <- new space:literal 30:literal/capacity) (c:character <- copy ((#\2 literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value) (c:character <- copy ((#\- literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value) (c:character <- copy ((#\a literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value) (c:character <- copy ((#\4 literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value)) ; check that read-move consumes them and then goes to sleep (when (ran-to-completion 'read-move) (prn "F - chessboard waits after each subsequent letter of move until the last")) (wipe completed-routines*) ; send final key ;? (prn "== final key") (restart read-move-routine) ;? (set dump-trace*) (run-code send-final-key (default-space:space-address <- new space:literal 30:literal/capacity) (c:character <- copy ((#\newline literal))) (x:tagged-value <- save-type c:character) (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value)) ; check that read-move consumes it and -- this time -- returns (when (~ran-to-completion 'read-move) (prn "F - 'read-move' completes after final letter of move")) ) (reset2) (new-trace "read-move-quit") (run-code main (default-space:space-address <- new space:literal 30:literal/capacity) (stdin:channel-address <- init-channel 1:literal) (dummy:terminal-address <- init-fake-terminal 20:literal 10:literal) (r:integer/routine <- fork-helper read-move:fn nil:literal/globals 2000:literal/limit stdin:channel-address dummy:terminal-address) (c:character <- copy ((#\q literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (sleep until-routine-done:literal r:integer/routine) ) (when (~ran-to-completion 'read-move) (prn "F - chessboard quits on move starting with 'q'")) (reset2) (new-trace "read-illegal-file") (run-code main (default-space:space-address <- new space:literal 30:literal/capacity) (stdin:channel-address <- init-channel 1:literal) (dummy:terminal-address <- init-fake-terminal 20:literal 10:literal) (r:integer/routine <- fork-helper read-file:fn nil:literal/globals 2000:literal/limit stdin:channel-address dummy:terminal-address) (c:character <- copy ((#\i literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (sleep until-routine-done:literal r:integer/routine) ) ;? (each routine completed-routines* ;? (prn " " routine)) (when (or (ran-to-completion 'read-file) (let routine routine-running!read-file (~posmatch "file too high" rep.routine!error))) (prn "F - 'read-file' checks that file lies between 'a' and 'h'")) (reset2) (new-trace "read-illegal-rank") (run-code main (default-space:space-address <- new space:literal 30:literal/capacity) (stdin:channel-address <- init-channel 1:literal) (dummy:terminal-address <- init-fake-terminal 20:literal 10:literal) (r:integer/routine <- fork-helper read-rank:fn nil:literal/globals 2000:literal/limit stdin:channel-address dummy:terminal-address) (c:character <- copy ((#\9 literal))) (x:tagged-value <- save-type c:character) (stdin:channel-address/deref <- write stdin:channel-address x:tagged-value) (sleep until-routine-done:literal r:integer/routine) ) (when (or (ran-to-completion 'read-rank) (let routine routine-running!read-rank (~posmatch "rank too high" rep.routine!error))) (prn "F - 'read-rank' checks that rank lies between '1' and '8'")) (reset2) (new-trace "print-board") (run-code main (default-space:space-address <- new space:literal 30:literal/capacity) ;? ($print (("init-array\n" literal))) ;? 1 (initial-position:integer-array-address <- init-array ((#\R literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\r literal)) ((#\N literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\n literal)) ((#\B literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\b literal)) ((#\Q literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\q literal)) ((#\K literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\k literal)) ((#\B literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\b literal)) ((#\N literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\n literal)) ((#\R literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\r literal))) ;? ($print (("init-board\n" literal))) ;? 1 (b:board-address <- init-board initial-position:integer-array-address) (screen:terminal-address <- init-fake-terminal 20:literal 10:literal) (print-board screen:terminal-address b:board-address) (1:string-address/raw <- get screen:terminal-address/deref data:offset) ) (each routine completed-routines* (awhen rep.routine!error (prn "error - " it))) ;? (prn memory*.1) (when (~screen-contains memory*.1 20 (+ "8 | r n b q k b n r " "7 | p p p p p p p p " "6 | _ _ _ _ _ _ _ _ " "5 | _ _ _ _ _ _ _ _ " "4 | _ _ _ _ _ _ _ _ " "3 | _ _ _ _ _ _ _ _ " "2 | P P P P P P P P " "1 | R N B Q K B N R " " +---------------- " " a b c d e f g h ")) (prn "F - print-board works; chessboard begins at @memory*.1")) ; todo: how to fold this more elegantly with the previous test? (reset2) (new-trace "make-move") (run-code main (default-space:space-address <- new space:literal 30:literal/capacity) ; fake screen (screen:terminal-address <- init-fake-terminal 20:literal 10:literal) ; initial position (initial-position:integer-array-address <- init-array ((#\R literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\r literal)) ((#\N literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\n literal)) ((#\B literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\b literal)) ((#\Q literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\q literal)) ((#\K literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\k literal)) ((#\B literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\b literal)) ((#\N literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\n literal)) ((#\R literal)) ((#\P literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\_ literal)) ((#\p literal)) ((#\r literal))) (b:board-address <- init-board initial-position:integer-array-address) ; move: a2-a4 (m:move-address <- new move:literal) (f:integer-integer-pair-address <- get-address m:move-address/deref from:offset) (dest:integer-address <- get-address f:integer-integer-pair-address/deref 0:offset) (dest:integer-address/deref <- copy 0:literal) ; from-file: a (dest:integer-address <- get-address f:integer-integer-pair-address/deref 1:offset) (dest:integer-address/deref <- copy 1:literal) ; from-rank: 2 (t0:integer-integer-pair-address <- get-address m:move-address/deref to:offset) (dest:integer-address <- get-address t0:integer-integer-pair-address/deref 0:offset) (dest:integer-address/deref <- copy 0:literal) ; to-file: a (dest:integer-address <- get-address t0:integer-integer-pair-address/deref 1:offset) (dest:integer-address/deref <- copy 3:literal) ; to-rank: 4 (b:board-address <- make-move b:board-address m:move-address) (print-board screen:terminal-address b:board-address) (1:string-address/raw <- get screen:terminal-address/deref data:offset) ) (each routine completed-routines* (awhen rep.routine!error (prn "error - " it))) ;? (prn memory*.1) (when (~screen-contains memory*.1 20 (+ "8 | r n b q k b n r " "7 | p p p p p p p p " "6 | _ _ _ _ _ _ _ _ " "5 | _ _ _ _ _ _ _ _ " "4 | P _ _ _ _ _ _ _ " "3 | _ _ _ _ _ _ _ _ " "2 | _ P P P P P P P " "1 | R N B Q K B N R " " +---------------- " " a b c d e f g h ")) (prn "F - make-move works; chessboard begins at @memory*.1")) (reset2)