| 
									
										
										
										
											2008-12-19 00:44:14 -05:00
										 |  |  | USING: io.directories io.files.links tools.test sequences | 
					
						
							|  |  |  | io.files.unique tools.files fry math kernel math.parser | 
					
						
							|  |  |  | io.pathnames namespaces ;
 | 
					
						
							| 
									
										
										
										
											2008-12-21 20:04:12 -05:00
										 |  |  | IN: io.files.links.unix.tests | 
					
						
							| 
									
										
										
										
											2008-12-18 19:32:00 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : make-test-links ( n path -- )
 | 
					
						
							| 
									
										
										
										
											2010-01-14 10:10:13 -05:00
										 |  |  |     [ '[ [ 1 + ] keep [ number>string _ prepend ] bi@ make-link ] each-integer ] | 
					
						
							| 
									
										
										
										
											2008-12-18 19:32:00 -05:00
										 |  |  |     [ [ number>string ] dip prepend touch-file ] 2bi ; inline
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ t ] [ | 
					
						
							|  |  |  |     [ | 
					
						
							| 
									
										
										
										
											2009-01-26 16:05:15 -05:00
										 |  |  |         current-temporary-directory get [ | 
					
						
							|  |  |  |             5 "lol" make-test-links | 
					
						
							|  |  |  |             "lol1" follow-links | 
					
						
							|  |  |  |             current-temporary-directory get "lol5" append-path =
 | 
					
						
							|  |  |  |         ] with-directory | 
					
						
							|  |  |  |     ] cleanup-unique-directory | 
					
						
							| 
									
										
										
										
											2008-12-18 19:32:00 -05:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ | 
					
						
							|  |  |  |     [ | 
					
						
							| 
									
										
										
										
											2009-01-26 16:05:15 -05:00
										 |  |  |         current-temporary-directory get [ | 
					
						
							|  |  |  |             100 "laf" make-test-links "laf1" follow-links | 
					
						
							|  |  |  |         ] with-directory | 
					
						
							| 
									
										
										
										
											2008-12-18 19:32:00 -05:00
										 |  |  |     ] with-unique-directory | 
					
						
							|  |  |  | ] [ too-many-symlinks? ] must-fail-with | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ t ] [ | 
					
						
							|  |  |  |     110 symlink-depth [ | 
					
						
							|  |  |  |         [ | 
					
						
							| 
									
										
										
										
											2009-01-26 16:05:15 -05:00
										 |  |  |             current-temporary-directory get [ | 
					
						
							|  |  |  |                 100 "laf" make-test-links | 
					
						
							|  |  |  |                 "laf1" follow-links | 
					
						
							|  |  |  |                 current-temporary-directory get "laf100" append-path =
 | 
					
						
							|  |  |  |             ] with-directory | 
					
						
							|  |  |  |         ] cleanup-unique-directory | 
					
						
							| 
									
										
										
										
											2008-12-18 19:32:00 -05:00
										 |  |  |     ] with-variable
 | 
					
						
							|  |  |  | ] unit-test |