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