]> gitweb.factorcode.org Git - factor.git/blob - basis/listener/listener-tests.factor
Fix permission bits
[factor.git] / basis / listener / listener-tests.factor
1 USING: io io.streams.string io.streams.duplex listener
2 tools.test parser math namespaces continuations vocabs kernel
3 compiler.units eval ;
4 IN: listener.tests
5
6 : hello "Hi" print ; parsing
7
8 : parse-interactive ( string -- quot )
9     <string-reader> stream-read-quot ;
10
11 [
12     [ [ ] ] [
13         "USE: listener.tests hello" parse-interactive
14     ] unit-test
15 ] with-file-vocabs
16
17 [
18     "debugger" use+
19
20     [ [ \ + 1 2 3 4 ] ]
21     [
22         [
23             "cont" set
24             [
25                 "\\ + 1 2 3 4" parse-interactive
26                 "cont" get continue-with
27             ] ignore-errors
28             "USE: debugger :1" eval
29         ] callcc1
30     ] unit-test
31 ] with-file-vocabs
32
33 [ ] [
34     [
35         "vocabs.loader.test.c" forget-vocab
36     ] with-compilation-unit
37 ] unit-test
38
39 [
40     [
41         "USE: vocabs.loader.test.c" parse-interactive
42     ] must-fail
43 ] with-file-vocabs
44
45 [ ] [
46     [
47         "vocabs.loader.test.c" forget-vocab
48     ] with-compilation-unit
49 ] unit-test
50
51 [
52     [ ] [
53         "IN: listener.tests : hello\n\"world\" ;" parse-interactive
54         drop
55     ] unit-test
56 ] with-file-vocabs