mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Patch #544740: test_commands test fails under Cygwin
Relax regular expression to handle spaces in user and group names.
This commit is contained in:
		
							parent
							
								
									b45b9feafb
								
							
						
					
					
						commit
						884554dfe5
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		|  | @ -38,13 +38,15 @@ def test_getoutput(self): | ||||||
| 
 | 
 | ||||||
|     def test_getstatus(self): |     def test_getstatus(self): | ||||||
|         # This pattern should match 'ls -ld /.' on any posix |         # This pattern should match 'ls -ld /.' on any posix | ||||||
|         # system, however perversely configured. |         # system, however perversely configured.  Even on systems | ||||||
|  |         # (e.g., Cygwin) where user and group names can have spaces: | ||||||
|  |         #     drwxr-xr-x   15 Administ Domain U     4096 Aug 12 12:50 / | ||||||
|  |         #     drwxr-xr-x   15 Joe User My Group     4096 Aug 12 12:50 / | ||||||
|  |         # Note that the first case above has a space in the group name | ||||||
|  |         # while the second one has a space in both names. | ||||||
|         pat = r'''d.........   # It is a directory. |         pat = r'''d.........   # It is a directory. | ||||||
|                   \s+\d+       # It has some number of links. |                   \s+\d+       # It has some number of links. | ||||||
|                   \s+\w+\s+\w+ # It has a user and group, which may |                   [^/]*        # Skip user, group, size, and date. | ||||||
|                                #     be named anything. |  | ||||||
|                   \s+\d+       # It has a size. |  | ||||||
|                   [^/]*        # Skip the date. |  | ||||||
|                   /\.          # and end with the name of the file. |                   /\.          # and end with the name of the file. | ||||||
|                ''' |                ''' | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jason Tishler
						Jason Tishler