summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/indent/wgsl/basic.wgsl43
-rw-r--r--tests/indent/wgsl_spec.lua19
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/indent/wgsl/basic.wgsl b/tests/indent/wgsl/basic.wgsl
new file mode 100644
index 00000000..7dd50f87
--- /dev/null
+++ b/tests/indent/wgsl/basic.wgsl
@@ -0,0 +1,43 @@
+struct Vertex {
+ @location(0) position: vec3<f32>,
+ @location(1) color: vec4<f32>,
+};
+
+@vertex
+fn vertex(vertex: Vertex) -> VertexOutput {
+ var out: VertexOutput;
+ out.a = 1;
+ if (1) {
+ out.a = 3;
+ }
+ if (2) {
+ dsa;
+ }
+
+ loop {
+ if (i >= 4) { break; }
+ }
+ out.b = 2;
+ return out;
+}
+
+@vertex
+fn vertex(vertex: Vertex,
+ foo: dso,
+ foo: dsa
+) -> VertexOutput {
+ var out: VertexOutput;
+ out.a = 1;
+ out.b = 2;
+ return out;
+}
+
+@vertex
+fn vertex(vertex: Vertex,
+ foo: dso,
+ foo: dsa) -> VertexOutput {
+ var out: VertexOutput;
+ out.a = 1;
+ out.b = 2;
+ return out;
+}
diff --git a/tests/indent/wgsl_spec.lua b/tests/indent/wgsl_spec.lua
new file mode 100644
index 00000000..4ffdbbda
--- /dev/null
+++ b/tests/indent/wgsl_spec.lua
@@ -0,0 +1,19 @@
+local Runner = require("tests.indent.common").Runner
+--local XFAIL = require("tests.indent.common").XFAIL
+
+local run = Runner:new(it, "tests/indent/wgsl", {
+ tabstop = 4,
+ shiftwidth = 4,
+ softtabstop = 0,
+ expandtab = true,
+})
+
+describe("indent WGSL:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function() end)
+end)