Fix parsing the third part of version string (#2355)

* Fix parsing the third part of version string
* Add test
* Test: fix checking cached version
This commit is contained in:
Tomasz N
2019-03-12 18:49:48 +01:00
committed by w0rp
parent 365ffae6c4
commit 5f03bae41c
2 changed files with 4 additions and 3 deletions

View File

@@ -14,10 +14,10 @@ function! ale#semver#GetVersion(executable, version_lines) abort
let l:version = get(s:version_cache, a:executable, [])
for l:line in a:version_lines
let l:match = matchlist(l:line, '\v(\d+)\.(\d+)\.?(\d?)')
let l:match = matchlist(l:line, '\v(\d+)\.(\d+)(\.(\d+))?')
if !empty(l:match)
let l:version = [l:match[1] + 0, l:match[2] + 0, l:match[3] + 0]
let l:version = [l:match[1] + 0, l:match[2] + 0, l:match[4] + 0]
let s:version_cache[a:executable] = l:version
break