summaryrefslogtreecommitdiff
path: root/test/handler/test_powershell_handler.vader
diff options
context:
space:
mode:
authorJesse Harris <zigford@gmail.com>2019-06-20 08:35:10 +1000
committerw0rp <w0rp@users.noreply.github.com>2019-06-19 23:35:10 +0100
commit9ad8fd6a1bdff5f0c80cf921df5628d1d322cf82 (patch)
tree63919838c450d460126b14272eb1fd6db98e3f65 /test/handler/test_powershell_handler.vader
parentd2c3141f266270a098d798c0d273a1068bdc5568 (diff)
downloadale-9ad8fd6a1bdff5f0c80cf921df5628d1d322cf82.zip
Handle powershell unexpected token with newline (#2588)
* Newline in unexpected token broke parser * fixed test to properly capture regressions * removed deprecated linter options for powershell
Diffstat (limited to 'test/handler/test_powershell_handler.vader')
-rwxr-xr-xtest/handler/test_powershell_handler.vader47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/handler/test_powershell_handler.vader b/test/handler/test_powershell_handler.vader
index 635bcd20..77c3dc65 100755
--- a/test/handler/test_powershell_handler.vader
+++ b/test/handler/test_powershell_handler.vader
@@ -60,3 +60,50 @@ Execute(The powershell handler should process multiple syntax errors from parsin
\ '+ CategoryInfo : NotSpecified: (:) [], ParseException',
\ '+ FullyQualifiedErrorId : ParseException'
\ ])
+Execute(The powershell handler should process unexecpected token that contains a newline character):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 8,
+ \ 'type': 'E',
+ \ 'text': 'The string is missing the terminator: ".',
+ \ 'code': 'ParseException'
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 8,
+ \ 'type': 'E',
+ \ 'text': 'Unexpected token ''"',
+ \ 'code': 'ParseException'
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Missing closing ''}'' in statement block or type definition.',
+ \ 'code': 'ParseException'
+ \ }
+ \ ],
+ \ ale_linters#powershell#powershell#Handle(bufnr(''), [
+ \ 'At line:2 char:8',
+ \ '+ "" "',
+ \ '+ ~',
+ \ 'The string is missing the terminator: ".',
+ \ 'At line:2 char:8',
+ \ '+ "" "',
+ \ '+ ~',
+ \ 'Unexpected token ''"',
+ \ '',
+ \ ' }'' in expression or statement.',
+ \ '',
+ \ 'At line:1 char:1',
+ \ '+ {',
+ \ '+ ~',
+ \ 'Missing closing ''}'' in statement block or type definition.',
+ \ 'At C:\Users\jpharris\AppData\Local\Temp\VIAA777.tmp\script.ps1:1 char:150',
+ \ '+ ... ontents); [void]$ExecutionContext.InvokeCommand.NewScriptBlock($Con ...',
+ \ '+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~',
+ \ ' + CategoryInfo : NotSpecified: (:) [], ParseException',
+ \ ' + FullyQualifiedErrorId : ParseException'
+ \ ])