tests: Run tests with WARN_CREATE_GLOBAL
This commit is contained in:
		
							parent
							
								
									c948a3caa0
								
							
						
					
					
						commit
						038409c10d
					
				|  | @ -27,7 +27,7 @@ | ||||||
| # vim: ft=zsh sw=2 ts=2 et | # vim: ft=zsh sw=2 ts=2 et | ||||||
| # ------------------------------------------------------------------------------------------------- | # ------------------------------------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
| x=/usr/bin/env | local x=/usr/bin/env | ||||||
| BUFFER='$x "argument"' | BUFFER='$x "argument"' | ||||||
| 
 | 
 | ||||||
| expected_region_highlight=( | expected_region_highlight=( | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| # vim: ft=zsh sw=2 ts=2 et | # vim: ft=zsh sw=2 ts=2 et | ||||||
| # ------------------------------------------------------------------------------------------------- | # ------------------------------------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
| lambda="''" | local lambda="''" | ||||||
| touch \$lambda | touch \$lambda | ||||||
| BUFFER=': \$lambda' | BUFFER=': \$lambda' | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -21,6 +21,9 @@ point will not fail the test), and `$todo` is used as the explanation. | ||||||
| **Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but | **Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but | ||||||
| interprets the indexes differently. | interprets the indexes differently. | ||||||
| 
 | 
 | ||||||
|  | **Note**: Tests are run with `setopt NOUNSET WARN_CREATE_GLOBAL`, so any | ||||||
|  | variables the test creates must be declared local. | ||||||
|  | 
 | ||||||
| **Isolation**: Each test is run in a separate subshell, so any variables, | **Isolation**: Each test is run in a separate subshell, so any variables, | ||||||
| aliases, functions, etc., it defines will be visible to the tested code (that | aliases, functions, etc., it defines will be visible to the tested code (that | ||||||
| computes `$region_highlight`), but will not affect subsequent tests.  The | computes `$region_highlight`), but will not affect subsequent tests.  The | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| # ------------------------------------------------------------------------------------------------- | # ------------------------------------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| setopt NOUNSET | setopt NO_UNSET WARN_CREATE_GLOBAL | ||||||
| 
 | 
 | ||||||
| # Check an highlighter was given as argument. | # Check an highlighter was given as argument. | ||||||
| [[ -n "$1" ]] || { | [[ -n "$1" ]] || { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue