mirror of
				https://github.com/actions/setup-dotnet.git
				synced 2025-10-31 16:13:46 +00:00 
			
		
		
		
	work on fixing test
This commit is contained in:
		
							parent
							
								
									36fa9877a9
								
							
						
					
					
						commit
						20afff9c90
					
				| @ -42,7 +42,6 @@ describe('version tests', () => { | ||||
|     '.2.3', | ||||
|     '.2.x', | ||||
|     '1', | ||||
|     '2.x', | ||||
|     '*.*.1', | ||||
|     '*.1', | ||||
|     '*.', | ||||
|  | ||||
							
								
								
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @ -16869,20 +16869,14 @@ class DotNetVersionInfo { | ||||
|             return; | ||||
|         } | ||||
|         //Note: No support for previews when using generic
 | ||||
|         let parts = version.split('.'); | ||||
|         const parts = version.split('.'); | ||||
|         if (parts.length < 2 || parts.length > 3) | ||||
|             this.throwInvalidVersionFormat(); | ||||
|         if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') { | ||||
|             this.throwInvalidVersionFormat(); | ||||
|         } | ||||
|         let major = this.getVersionNumberOrThrow(parts[0]); | ||||
|         let minor; | ||||
|         if (parts[1] === 'x') { | ||||
|             minor = parts[1]; | ||||
|         } | ||||
|         else { | ||||
|             minor = this.getVersionNumberOrThrow(parts[1]); | ||||
|         } | ||||
|         const major = this.getVersionNumberOrThrow(parts[0]); | ||||
|         const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); | ||||
|         this.fullversion = major + '.' + minor; | ||||
|     } | ||||
|     getVersionNumberOrThrow(input) { | ||||
|  | ||||
| @ -30,7 +30,7 @@ export class DotNetVersionInfo { | ||||
|     } | ||||
| 
 | ||||
|     //Note: No support for previews when using generic
 | ||||
|     let parts: string[] = version.split('.'); | ||||
|     const parts: string[] = version.split('.'); | ||||
| 
 | ||||
|     if (parts.length < 2 || parts.length > 3) this.throwInvalidVersionFormat(); | ||||
| 
 | ||||
| @ -38,13 +38,8 @@ export class DotNetVersionInfo { | ||||
|       this.throwInvalidVersionFormat(); | ||||
|     } | ||||
| 
 | ||||
|     let major = this.getVersionNumberOrThrow(parts[0]); | ||||
|     let minor; | ||||
|     if (parts[1] === 'x') { | ||||
|       minor = parts[1]; | ||||
|     } else { | ||||
|       minor = this.getVersionNumberOrThrow(parts[1]); | ||||
|     } | ||||
|     const major = this.getVersionNumberOrThrow(parts[0]); | ||||
|     const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); | ||||
| 
 | ||||
|     this.fullversion = major + '.' + minor; | ||||
|   } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user