summaryrefslogtreecommitdiff
path: root/test/handler/test_naga_handler.vader
diff options
context:
space:
mode:
authorLinda_pp <rhysd@users.noreply.github.com>2022-02-04 16:29:28 +0900
committerGitHub <noreply@github.com>2022-02-04 16:29:28 +0900
commit0d529d9b948d21065789c5670500cbfba5386f6f (patch)
treecc5b73feea8a88bc0c8b8a6f7e829b2f464fb29a /test/handler/test_naga_handler.vader
parentd1e2aaf85dc81bad223065eec474d9f090fec70e (diff)
downloadale-0d529d9b948d21065789c5670500cbfba5386f6f.zip
Add `naga` linter for WGSL support (#4047)
* Add WGSL support using `naga` command * Add documents for wgsl * Add test for `naga` linter * Separate naga handler callback to hanlder/naga.vim
Diffstat (limited to 'test/handler/test_naga_handler.vader')
-rw-r--r--test/handler/test_naga_handler.vader23
1 files changed, 23 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