]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_nix_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 '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_nix_handler.vader
1 Before:
2   runtime ale_linters/nix/nix.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute(The nix handler should parse nix-instantiate error messages correctly):
8   AssertEqual
9   \ [
10   \   {
11   \     'lnum': 6,
12   \     'col': 3,
13   \     'type': 'E',
14   \     'text': "syntax error, unexpected ']', expecting ';'",
15   \   },
16   \   {
17   \     'lnum': 3,
18   \     'col': 5,
19   \     'type': 'E',
20   \     'text': "undefined variable 'foo'",
21   \   },
22   \
23   \ ],
24   \ ale_linters#nix#nix#Handle(bufnr(''), [
25   \   "@nix {\"line\":6,\"column\":3,\"raw_msg\":\"syntax error, unexpected ']', expecting ';'\"}",
26   \   "@nix {\"line\":3,\"column\":5,\"raw_msg\":\"undefined variable 'foo'\"}",
27   \   "@nix {\"unrelated\":\"message\"}"
28   \ ])
29
30 Execute(The nix handler should parse nix-instantiate error messages with ANSI color codes correctly):
31   AssertEqual
32   \ [
33   \   {
34   \     'lnum': 3,
35   \     'col': 5,
36   \     'type': 'E',
37   \     'text': "undefined variable 'foo'",
38   \   },
39   \
40   \ ],
41   \ ale_linters#nix#nix#Handle(bufnr(''), [
42   \   "@nix {\"line\":3,\"column\":5,\"raw_msg\":\"undefined variable '\\u001b[35;1mfoo\\u001b[0m'\"}",
43   \   "@nix {\"unrelated\":\"message\"}"
44   \ ])
45
46 Execute(The nix handler should parse message from old nix-instantiate correctly):
47   AssertEqual
48   \ [
49   \   {
50   \     'lnum': 23,
51   \     'col': 14,
52   \     'text': 'error: syntax error, unexpected IN',
53   \     'type': 'E',
54   \   },
55   \   {
56   \     'lnum': 3,
57   \     'col': 12,
58   \     'text': 'error: syntax error, unexpected ''='', expecting '';''',
59   \     'type': 'E',
60   \   },
61   \
62   \ ],
63   \ ale_linters#nix#nix#Handle(47, [
64   \   'This line should be ignored',
65   \   'error: syntax error, unexpected IN, at /path/to/filename.nix:23:14',
66   \   'error: syntax error, unexpected ''='', expecting '';'', at /path/to/filename.nix:3:12',
67   \ ])
68
69 Execute(The nix command should not add 'log-format' option for nix version 2.3):
70   AssertEqual
71   \ 'nix-instantiate --parse -',
72   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.3.0'], '')
73
74 Execute(The nix command should add 'log-format' option for nix version 2.4):
75   AssertEqual
76   \ 'nix-instantiate --log-format internal-json --parse -',
77   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.4.1'], '')
78
79 Execute(The nix command should add 'log-format' option for nix version 2.5):
80   AssertEqual
81   \ 'nix-instantiate --log-format internal-json --parse -',
82   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.5.0pre20211206_d1aaa7e'], '')
83
84 Execute(The nix command should add 'log-format' option for nix version 2.6):
85   AssertEqual
86   \ 'nix-instantiate --log-format internal-json --parse -',
87   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.6.0pre20211206_ignored'], '')
88
89 Execute(The nix command should add 'log-format' option for nix version 2.7):
90   AssertEqual
91   \ 'nix-instantiate --log-format internal-json --parse -',
92   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.7.0pre20211206_ignored'], '')
93
94 Execute(The nix command should add 'log-format' option for nix version 2.8):
95   AssertEqual
96   \ 'nix-instantiate --log-format internal-json --parse -',
97   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.8.0pre20211206_ignored'], '')
98
99 Execute(The nix command should add 'log-format' option for nix version 2.9):
100   AssertEqual
101   \ 'nix-instantiate --log-format internal-json --parse -',
102   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.9.0pre20211206_ignored'], '')
103
104 Execute(The nix command should add 'log-format' option for nix version 2.10):
105   AssertEqual
106   \ 'nix-instantiate --log-format internal-json --parse -',
107   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.10.0pre20221221_ignored'], '')
108
109 Execute(The nix command should add 'log-format' option for nix version 2.20):
110   AssertEqual
111   \ 'nix-instantiate --log-format internal-json --parse -',
112   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 2.20.0pre20221221_ignored'], '')
113
114 Execute(The nix command should add 'log-format' option for nix version 3.0):
115   AssertEqual
116   \ 'nix-instantiate --log-format internal-json --parse -',
117   \ ale_linters#nix#nix#Command('', ['nix-instantiate (Nix) 3.0.0pre20211206_ignored'], '')