summaryrefslogtreecommitdiff
path: root/test/handler/test_deadnix_handler.vader
blob: 242af88163068f984b1da7bbeced19aae0db61d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Execute(The deadnix handler should handle deadnix output):
  let output = [
  \'{"file":"./flake.nix","results":[{"column":5,"endColumn":9,"line":23,"message":"Unused lambda pattern: self"},{"column":2,"endColumn":6,"line":1,"message":"Unused lambda pattern: pkgs"}]}'
  \]

  AssertEqual
  \ [
  \   {
  \     'lnum': 23,
  \     'col': 5,
  \     'end_col': 9,
  \     'text': 'Unused lambda pattern: self',
  \     'type': 'W',
  \   },
  \   {
  \     'lnum': 1,
  \     'col': 2,
  \     'end_col': 6,
  \     'text': 'Unused lambda pattern: pkgs',
  \     'type': 'W',
  \   },
  \ ],
  \ ale#handlers#deadnix#Handle(bufnr(''), output)

  AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), [''])
  AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), ['not json'])
  AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), ['{"results":[{}]}'])