diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_naga_handler.vader | 23 | ||||
-rw-r--r-- | test/linter/test_naga.vader | 10 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/handler/test_naga_handler.vader b/test/handler/test_naga_handler.vader new file mode 100644 index 00000000..48b8c281 --- /dev/null +++ b/test/handler/test_naga_handler.vader @@ -0,0 +1,23 @@ +Before: + runtime ale_linters/wgsl/naga.vim + +After: + call ale#linter#Reset() + +Execute(Error handler should parse error message and position from input): + let example_output = [ + \ "error: expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file, found '['", + \ " ┌─ wgsl:5:1", + \ " │", + \ "5 │ [[group(1), binding(0)]]", + \ " │ ^ expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file", + \ "Could not parse WGSL", + \ ] + let actual = ale#handlers#naga#Handle(0, example_output) + let expected = [{ + \ "text": "expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file, found '['", + \ "lnum": 5, + \ "col": 1, + \ "type": "E", + \ }] + AssertEqual actual, expected diff --git a/test/linter/test_naga.vader b/test/linter/test_naga.vader new file mode 100644 index 00000000..bf91604b --- /dev/null +++ b/test/linter/test_naga.vader @@ -0,0 +1,10 @@ +Before: + call ale#assert#SetUpLinterTest('wgsl', 'naga') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The naga command should be customizable): + let g:ale_wgsl_naga_executable = '/path/to/naga' + AssertLinter '/path/to/naga', + \ ale#Escape('/path/to/naga') . ' --stdin-file-path %s' |