]> gitweb.factorcode.org Git - factor.git/blob - basis/io/unix/linux/monitors/monitors-tests.factor
Create basis vocab root
[factor.git] / basis / io / unix / linux / monitors / monitors-tests.factor
1 IN: io.unix.linux.monitors.tests
2 USING: io.monitors tools.test io.files system sequences
3 continuations namespaces concurrency.count-downs kernel io
4 threads calendar prettyprint destructors io.timeouts ;
5
6 ! On Linux, a notification on the directory itself would report an invalid
7 ! path name
8 [
9     [ ] [ "monitor-test-self" temp-file make-directories ] unit-test
10     
11     ! Non-recursive
12     [ ] [ "monitor-test-self" temp-file f <monitor> "m" set ] unit-test
13
14     [ ] [ "monitor-test-self" temp-file touch-file ] unit-test
15
16     [ t ] [
17         "m" get next-change drop
18         [ "" = ] [ "monitor-test-self" temp-file = ] bi or
19     ] unit-test
20
21     [ ] [ "m" get dispose ] unit-test
22     
23     ! Recursive
24     [ ] [ "monitor-test-self" temp-file t <monitor> "m" set ] unit-test
25
26     [ ] [ "monitor-test-self" temp-file touch-file ] unit-test
27
28     [ t ] [
29         "m" get next-change drop
30         [ "" = ] [ "monitor-test-self" temp-file = ] bi or
31     ] unit-test
32
33     [ ] [ "m" get dispose ] unit-test
34 ] with-monitors