summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-07-06 20:01:52 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2021-01-24 22:54:02 +0100
commit72dbd7f648e90c1a9e73234719458c73b0b415dc (patch)
treec1c1aafb9835fb686e23e3ee999e82b61f5eb422 /test
parent9a1e91e075abf386e8c6fd620ec0835e566a7db1 (diff)
downloadale-72dbd7f648e90c1a9e73234719458c73b0b415dc.zip
Update error-parser for `nix-instantiate` on Nix 2.4+
In the (unreleased) Nix 2.4 the error-messages have been reformatted[1]. This patch aims to retain proper `.nix`-support in `ale`, for both stable Nix (2.3 and older) and unstable Nix (2.4 and newer). [1] https://github.com/NixOS/nix/pull/3590
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_nix_handler.vader23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/handler/test_nix_handler.vader b/test/handler/test_nix_handler.vader
index 398e1ac8..87e8b68f 100644
--- a/test/handler/test_nix_handler.vader
+++ b/test/handler/test_nix_handler.vader
@@ -8,6 +8,29 @@ Execute(The nix handler should parse nix-instantiate error messages correctly):
AssertEqual
\ [
\ {
+ \ 'lnum': 6,
+ \ 'col': 3,
+ \ 'type': 'E',
+ \ 'text': "syntax error, unexpected ']', expecting ';'",
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 5,
+ \ 'type': 'E',
+ \ 'text': "undefined variable 'foo'",
+ \ },
+ \
+ \ ],
+ \ ale_linters#nix#nix#Handle(bufnr(''), [
+ \ "@nix {\"line\":6,\"column\":3,\"raw_msg\":\"syntax error, unexpected ']', expecting ';'\"}",
+ \ "@nix {\"line\":3,\"column\":5,\"raw_msg\":\"undefined variable 'foo'\"}",
+ \ "@nix {\"unrelated\":\"message\"}"
+ \ ])
+
+Execute(The nix handler should parse message from old nix-instantiate correctly):
+ AssertEqual
+ \ [
+ \ {
\ 'lnum': 23,
\ 'col': 14,
\ 'text': 'error: syntax error, unexpected IN',