X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/test/handler/test_zlint_handler.vader diff --git a/.vim/bundle/ale/test/handler/test_zlint_handler.vader b/.vim/bundle/ale/test/handler/test_zlint_handler.vader new file mode 100644 index 00000000..c803e06a --- /dev/null +++ b/.vim/bundle/ale/test/handler/test_zlint_handler.vader @@ -0,0 +1,44 @@ +Before: + runtime ale_linters/zig/zlint.vim + +After: + call ale#linter#Reset() + +Execute(The zlint handler should parse GitHub Actions format correctly): + " Create a temporary buffer + let buffer = bufnr('') + + " Define input lines + let input_lines = [ + \ '::warning file=test.zig,line=61,col=47,title=unsafe-undefined::`undefined` is missing a safety comment', + \ '', + \ '::error file=test2.zig,line=4,col=33,title=no-unresolved::Unresolved import to ''test3.zig''', + \ '', + \ ] + + " Define expected output + let expected_output = [ + \ { + \ 'filename': 'test.zig', + \ 'lnum': 61, + \ 'col': 47, + \ 'text': '`undefined` is missing a safety comment', + \ 'type': 'W', + \ 'code': 'unsafe-undefined' + \ }, + \ { + \ 'filename': 'test2.zig', + \ 'lnum': 4, + \ 'col': 33, + \ 'text': 'Unresolved import to ''test3.zig''', + \ 'type': 'E', + \ 'code': 'no-unresolved' + \ }, + \ ] + + " Get actual output + let actual_output = ale_linters#zig#zlint#Handle(buffer, input_lines) + + " Assert equality + AssertEqual expected_output, actual_output +