]> gitweb.factorcode.org Git - factor.git/blob - extra/curses/curses-tests.factor
Reformat
[factor.git] / extra / curses / curses-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: calendar curses curses.ffi kernel random sequences threads
4 tools.test ;
5 IN: curses.tests
6
7 : hello-curses ( -- )
8     <curses-window> [
9         "Hello Curses!" [
10             dup cmove addch
11         ] each-index
12         crefresh
13
14         2 seconds sleep
15     ] with-curses ;
16
17 : hello-curses-color ( -- )
18     <curses-window> [
19         "Hello Curses!" [
20             8 random 8 random ccolor addch
21         ] each crefresh
22
23         2 seconds sleep
24     ] with-curses ;
25
26 curses-ok? [
27     { } [ hello-curses ] unit-test
28     has_colors [
29         { } [ hello-curses-color ] unit-test
30     ] when
31 ] when