]> gitweb.factorcode.org Git - factor.git/blob - extra/curses/curses-tests.factor
9ffd1916812fabdeb8aca716bcf138df32cdace3
[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: accessors calendar curses kernel threads tools.test
4 strings sequences random ;
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     [ ] [ hello-curses-color ] unit-test
29 ] when