Get the TSLint tempname test running on Windows
This commit is contained in:
parent
e0c3cbd16f
commit
31241e9ed8
@ -12,6 +12,9 @@ After:
|
|||||||
Restore
|
Restore
|
||||||
|
|
||||||
unlet! b:ale_typescript_tslint_ignore_empty_files
|
unlet! b:ale_typescript_tslint_ignore_empty_files
|
||||||
|
unlet! b:relative_to_root
|
||||||
|
unlet! b:tempname_suffix
|
||||||
|
unlet! b:relative_tempname
|
||||||
|
|
||||||
call ale#test#RestoreDirectory()
|
call ale#test#RestoreDirectory()
|
||||||
call ale#linter#Reset()
|
call ale#linter#Reset()
|
||||||
@ -282,9 +285,12 @@ Execute(The tslint handler should not report no-implicit-dependencies errors):
|
|||||||
\ }])])
|
\ }])])
|
||||||
|
|
||||||
Execute(The tslint handler should set filename keys for temporary files):
|
Execute(The tslint handler should set filename keys for temporary files):
|
||||||
if !has('win32')
|
|
||||||
" The temporay filename below is hacked into being a relative path so we can
|
" The temporay filename below is hacked into being a relative path so we can
|
||||||
" test that we resolve the temporary filename first.
|
" test that we resolve the temporary filename first.
|
||||||
|
let b:relative_to_root = substitute(expand('%:p'), '\v[^/\\]*([/\\])[^/\\]*', has('win32') ? '..\' : '../', 'g')
|
||||||
|
let b:tempname_suffix = substitute(tempname(), '^\v([A-Z]:)?[/\\]', '', '')
|
||||||
|
let b:relative_tempname = b:relative_to_root . b:tempname_suffix
|
||||||
|
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [
|
\ [
|
||||||
\ {'lnum': 47, 'col': 1, 'code': 'curly', 'end_lnum': 47, 'type': 'E', 'end_col': 26, 'text': 'if statements must be braced'},
|
\ {'lnum': 47, 'col': 1, 'code': 'curly', 'end_lnum': 47, 'type': 'E', 'end_col': 26, 'text': 'if statements must be braced'},
|
||||||
@ -297,7 +303,7 @@ Execute(The tslint handler should set filename keys for temporary files):
|
|||||||
\ 'position':1383,
|
\ 'position':1383,
|
||||||
\ },
|
\ },
|
||||||
\ 'failure': 'if statements must be braced',
|
\ 'failure': 'if statements must be braced',
|
||||||
\ 'name': substitute(substitute(substitute(expand('%:p'), '[^/\\]', '', 'g'), '.', '../', 'g') . tempname(), '\([A-Z]:\\\)[A-Z]:', '\1', ''),
|
\ 'name': b:relative_tempname,
|
||||||
\ 'ruleName': 'curly',
|
\ 'ruleName': 'curly',
|
||||||
\ 'ruleSeverity':'ERROR',
|
\ 'ruleSeverity':'ERROR',
|
||||||
\ 'startPosition': {
|
\ 'startPosition': {
|
||||||
@ -307,4 +313,3 @@ Execute(The tslint handler should set filename keys for temporary files):
|
|||||||
\ }
|
\ }
|
||||||
\ },
|
\ },
|
||||||
\ ])])
|
\ ])])
|
||||||
endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user