mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-30 17:25:51 +08:00 
			
		
		
		
	use regex triplet, add unit test
This commit is contained in:
		
							
								
								
									
										11
									
								
								test/fast/Unit tests/nvm_strip_path
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								test/fast/Unit tests/nvm_strip_path
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| die () { echo $@ ; exit 1; } | ||||
|  | ||||
| . ../../../nvm.sh | ||||
|  | ||||
| TEST_PATH=$NVM_DIR/v0.10.5/bin:/usr/bin:$NVM_DIR/v0.11.5/bin:$NVM_DIR/v0.9.5/bin:/usr/local/bin:$NVM_DIR/v0.2.5/bin | ||||
|  | ||||
| STRIPPED_PATH=`nvm_strip_path "$TEST_PATH" "/bin"` | ||||
|  | ||||
| [ "$STRIPPED_PATH" = "/usr/bin:/usr/local/bin" ] || die "Not correctly stripped: $STRIPPED_PATH " | ||||
		Reference in New Issue
	
	Block a user