From b63edfd493bc13c424edd81f96752918115610a8 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@vista64.(none)>
Date: Wed, 9 Apr 2008 19:54:48 -0500
Subject: [PATCH] Add unit tests for monitors

---
 extra/io/monitors/monitors-tests.factor | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/extra/io/monitors/monitors-tests.factor b/extra/io/monitors/monitors-tests.factor
index fb687f6876..4bb5db9f0a 100644
--- a/extra/io/monitors/monitors-tests.factor
+++ b/extra/io/monitors/monitors-tests.factor
@@ -1,29 +1,34 @@
 IN: io.monitors.tests
 USING: io.monitors tools.test io.files system sequences
 continuations namespaces concurrency.count-downs kernel io
-threads calendar ;
+threads calendar prettyprint ;
 
 os { winnt macosx linux } member? [
     [ "monitor-test" temp-file delete-tree ] ignore-errors
 
-    [ ] [ "monitor-test" temp-file make-directory ] unit-test
+    [ ] [ "monitor-test/xyz" temp-file make-directories ] unit-test
 
     [ ] [ "monitor-test" temp-file t <monitor> "m" set ] unit-test
 
+    [ ] [ 1 <count-down> "b" set ] unit-test
+
     [ ] [ 1 <count-down> "c" set ] unit-test
 
     [ ] [
         [
+            "b" get count-down
            [
                "m" get next-change drop
-               dup print flush
-               "test.txt" tail? not
+               dup print flush right-trim-separators
+               "xyz" tail? not
            ] [ ] [ ] while
            "c" get count-down
         ] "Monitor test thread" spawn drop
     ] unit-test
 
-    [ ] [ "monitor-test/test.txt" touch-file ] unit-test
+    [ ] [ "b" get await ] unit-test
+
+    [ ] [ "monitor-test/xyz/test.txt" temp-file touch-file ] unit-test
 
     [ ] [ "c" get 30 seconds await-timeout ] unit-test
 ] when