]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_puppet_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_puppet_handler.vader
1 Before:
2   runtime ale_linters/puppet/puppet.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute(The puppet handler should parse lines correctly when no column is supplied):
8   " Line Error
9   AssertEqual
10   \ [
11   \   {
12   \     'lnum': 5,
13   \     'col': 0,
14   \     'text': "Syntax error at '='; expected '}'"
15   \   },
16   \   {
17   \     'lnum': 3,
18   \     'col': 0,
19   \     'text': "Syntax error at '='; expected '}'"
20   \   },
21   \ ],
22   \ ale_linters#puppet#puppet#Handle(255, [
23   \   "Error: Could not parse for environment production: Syntax error at '='; expected '}' at /root/puppetcode/modules/pancakes/manifests/init.pp:5",
24   \   "Error: Could not parse for environment production: Syntax error at '='; expected '}' at C:/puppet/modules/pancakes/manifests/init.pp:3",
25   \ ])
26
27 Execute(The puppet handler should parse lines and column correctly):
28   " Line Error
29   AssertEqual
30   \ [
31   \   {
32   \     'lnum': 43,
33   \     'col': 12,
34   \     'text': "Syntax error at ':'"
35   \   },
36   \   {
37   \     'lnum': 54,
38   \     'col': 9,
39   \     'text': "Syntax error at ':'"
40   \   },
41   \   {
42   \     'lnum': 45,
43   \     'col': 12,
44   \     'text': "Syntax error at 'parameter1'"
45   \   },
46   \ ],
47   \ ale_linters#puppet#puppet#Handle(255, [
48   \   "Error: Could not parse for environment production: Syntax error at ':' at /root/puppetcode/modules/nginx/manifests/init.pp:43:12",
49   \   "Error: Could not parse for environment production: Syntax error at ':' at C:/puppet/modules/nginx/manifests/init.pp:54:9",
50   \   "Error: Could not parse for environment production: Syntax error at 'parameter1' (file: /tmp/modules/mariadb/manifests/slave.pp, line: 45, column: 12)",
51   \ ])
52
53 Execute(The puppet handler should correctly parse errors that are reported before even trying to parse for an environment):
54   " Line Error
55   AssertEqual
56   \ [
57   \   {
58   \     'lnum': 5,
59   \     'col': 11,
60   \     'text': "Illegal attempt to assign to 'a Name'. Not an assignable reference"
61   \   },
62   \ ],
63   \ ale_linters#puppet#puppet#Handle(255, [
64   \   "Error: Illegal attempt to assign to 'a Name'. Not an assignable reference (file: /tmp/modules/waffles/manifests/syrup.pp, line: 5, column: 11)",
65   \ ])
66 Execute(The puppet handler should parse lines when end of input is the location):
67   AssertEqual
68   \ [
69   \   {
70   \     'lnum': 0,
71   \     'col': 0,
72   \     'text': "Syntax error at end of input"
73   \   },
74   \ ],
75   \ ale_linters#puppet#puppet#Handle(255, [
76   \   "Error: Could not parse for environment production: Syntax error at end of input (file: /tmp//modules/test/manifests/init.pp)",
77   \ ])