io.monitors: change tests to not use unique because it only ever used temp-file.
							parent
							
								
									7c2e8d0fad
								
							
						
					
					
						commit
						f5b31a85c0
					
				| 
						 | 
				
			
			@ -1,12 +1,11 @@
 | 
			
		|||
USING: accessors calendar concurrency.count-downs
 | 
			
		||||
concurrency.promises continuations destructors io io.directories
 | 
			
		||||
io.directories.hierarchy io.files io.files.temp io.files.unique
 | 
			
		||||
io.monitors io.pathnames io.timeouts kernel namespaces sequences
 | 
			
		||||
system threads tools.test ;
 | 
			
		||||
io.directories.hierarchy io.files io.files.temp io.monitors
 | 
			
		||||
io.pathnames io.timeouts kernel namespaces sequences system
 | 
			
		||||
threads tools.test ;
 | 
			
		||||
IN: io.monitors.tests
 | 
			
		||||
 | 
			
		||||
os { windows linux macosx } member? [
 | 
			
		||||
    [
 | 
			
		||||
    [
 | 
			
		||||
        [ "monitor-test" temp-file delete-tree ] ignore-errors
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -34,10 +33,8 @@ os { windows linux macosx } member? [
 | 
			
		|||
        [ t ] [ "monitor-test/a2/a1/a4.txt" temp-file exists? ] unit-test
 | 
			
		||||
 | 
			
		||||
        [ ] [ "m" get dispose ] unit-test
 | 
			
		||||
        ] with-unique-directory delete-tree
 | 
			
		||||
    ] with-monitors
 | 
			
		||||
 | 
			
		||||
    [
 | 
			
		||||
    [
 | 
			
		||||
        [ "monitor-test" temp-file delete-tree ] ignore-errors
 | 
			
		||||
        [ ] [ "monitor-test/xyz" temp-file make-directories ] unit-test
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +76,6 @@ os { windows linux macosx } member? [
 | 
			
		|||
        ! Dispose twice
 | 
			
		||||
        [ ] [ "m" get dispose ] unit-test
 | 
			
		||||
        [ ] [ "m" get dispose ] unit-test
 | 
			
		||||
        ] with-unique-directory delete-tree
 | 
			
		||||
    ] with-monitors
 | 
			
		||||
 | 
			
		||||
    ! Out-of-scope disposal should not fail
 | 
			
		||||
| 
						 | 
				
			
			@ -87,7 +83,6 @@ os { windows linux macosx } member? [
 | 
			
		|||
    [ ] [ [ "" resource-path t <monitor> ] with-monitors dispose ] unit-test
 | 
			
		||||
 | 
			
		||||
    ! Timeouts
 | 
			
		||||
    [
 | 
			
		||||
    [
 | 
			
		||||
        [ ] [ "monitor-timeout-test" temp-file make-directories ] unit-test
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -102,12 +97,10 @@ os { windows linux macosx } member? [
 | 
			
		|||
        [ ] [ 100 milliseconds "m" get set-timeout ] unit-test
 | 
			
		||||
        [ [ t ] [ "m" get next-change drop ] while ] must-fail
 | 
			
		||||
        [ ] [ "m" get dispose ] unit-test
 | 
			
		||||
        ] with-unique-directory delete-tree
 | 
			
		||||
    ] with-monitors
 | 
			
		||||
 | 
			
		||||
    ! Disposing a monitor should throw an error in any threads
 | 
			
		||||
    ! waiting on notifications
 | 
			
		||||
    [
 | 
			
		||||
    [
 | 
			
		||||
        [ ] [
 | 
			
		||||
            <promise> "p" set
 | 
			
		||||
| 
						 | 
				
			
			@ -123,6 +116,5 @@ os { windows linux macosx } member? [
 | 
			
		|||
        [ ] [ 100 milliseconds sleep ] unit-test
 | 
			
		||||
        [ ] [ "m" get dispose ] unit-test
 | 
			
		||||
        [ t ] [ "p" get 10 seconds ?promise-timeout already-disposed? ] unit-test
 | 
			
		||||
        ] with-unique-directory delete-tree
 | 
			
		||||
    ] with-monitors
 | 
			
		||||
] when
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue