summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIvan Tham <pickfire@riseup.net>2020-09-27 15:53:15 +0800
committerIvan Tham <pickfire@riseup.net>2020-09-27 15:53:15 +0800
commit5c8dfcdfa946d9018150e67a32f472b2e80a9cd7 (patch)
tree3164235b816a4cafdf3f498eff1642ecda798999 /test
parent11d98a07dc5ad7e8af8971f1ba5352cc7140b1dc (diff)
Rust improve align after partial statement
Diffstat (limited to 'test')
-rw-r--r--test/indent/rust/after-variable/cmd1
-rw-r--r--test/indent/rust/after-variable/in6
-rw-r--r--test/indent/rust/after-variable/out9
-rw-r--r--test/indent/rust/after-variable/rc3
-rw-r--r--test/indent/rust/after-where/in2
-rw-r--r--test/indent/rust/after-where/out3
-rw-r--r--test/indent/rust/line-start-with-operator/bar36
-rw-r--r--test/indent/rust/line-start-with-operator/cmd1
-rw-r--r--test/indent/rust/line-start-with-operator/in26
-rw-r--r--test/indent/rust/line-start-with-operator/out39
-rw-r--r--test/indent/rust/line-start-with-operator/rc3
11 files changed, 124 insertions, 5 deletions
diff --git a/test/indent/rust/after-variable/cmd b/test/indent/rust/after-variable/cmd
new file mode 100644
index 00000000..932ef40d
--- /dev/null
+++ b/test/indent/rust/after-variable/cmd
@@ -0,0 +1 @@
+c<ret>.baz()<esc>
diff --git a/test/indent/rust/after-variable/in b/test/indent/rust/after-variable/in
new file mode 100644
index 00000000..59951f6d
--- /dev/null
+++ b/test/indent/rust/after-variable/in
@@ -0,0 +1,6 @@
+ foo%( )
+
+ Foo(bar)%( )
+
+ Foo { bar }%( )
+
diff --git a/test/indent/rust/after-variable/out b/test/indent/rust/after-variable/out
new file mode 100644
index 00000000..4f5315a0
--- /dev/null
+++ b/test/indent/rust/after-variable/out
@@ -0,0 +1,9 @@
+ foo
+ .baz()
+
+ Foo(bar)
+ .baz()
+
+ Foo { bar }
+ .baz()
+
diff --git a/test/indent/rust/after-variable/rc b/test/indent/rust/after-variable/rc
new file mode 100644
index 00000000..64064c25
--- /dev/null
+++ b/test/indent/rust/after-variable/rc
@@ -0,0 +1,3 @@
+source "%val{runtime}/colors/default.kak"
+source "%val{runtime}/rc/filetype/rust.kak"
+set buffer filetype rust
diff --git a/test/indent/rust/after-where/in b/test/indent/rust/after-where/in
index 412f13d3..d935a00c 100644
--- a/test/indent/rust/after-where/in
+++ b/test/indent/rust/after-where/in
@@ -1,5 +1,3 @@
- impl X for T where%( )
-
impl X for T
where%( )
diff --git a/test/indent/rust/after-where/out b/test/indent/rust/after-where/out
index 3cc8383e..caa373e4 100644
--- a/test/indent/rust/after-where/out
+++ b/test/indent/rust/after-where/out
@@ -1,6 +1,3 @@
- impl X for T where
- bar
-
impl X for T
where
bar
diff --git a/test/indent/rust/line-start-with-operator/bar b/test/indent/rust/line-start-with-operator/bar
new file mode 100644
index 00000000..3aa5220d
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/bar
@@ -0,0 +1,36 @@
+ .foo
+ bar
+
+ + foo
+ bar
+
+ - foo
+ bar
+
+ * foo
+ bar
+
+ / foo
+ bar
+
+ & foo
+ bar
+
+ | foo
+ bar
+
+ ^ foo
+ bar
+
+ && foo
+ bar
+
+ || foo
+ bar
+
+ < foo
+ bar
+
+ > foo
+ bar
+
diff --git a/test/indent/rust/line-start-with-operator/cmd b/test/indent/rust/line-start-with-operator/cmd
new file mode 100644
index 00000000..8682d51e
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/cmd
@@ -0,0 +1 @@
+c<ret>bar<esc>
diff --git a/test/indent/rust/line-start-with-operator/in b/test/indent/rust/line-start-with-operator/in
new file mode 100644
index 00000000..0b17056b
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/in
@@ -0,0 +1,26 @@
+ .foo%( )
+
+ .foo()%( )
+
+ + foo%( )
+
+ - foo%( )
+
+ * foo%( )
+
+ / foo%( )
+
+ & foo%( )
+
+ | foo%( )
+
+ ^ foo%( )
+
+ && foo%( )
+
+ || foo%( )
+
+ < foo%( )
+
+ > foo%( )
+
diff --git a/test/indent/rust/line-start-with-operator/out b/test/indent/rust/line-start-with-operator/out
new file mode 100644
index 00000000..f81bfdec
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/out
@@ -0,0 +1,39 @@
+ .foo
+ bar
+
+ .foo()
+ bar
+
+ + foo
+ bar
+
+ - foo
+ bar
+
+ * foo
+ bar
+
+ / foo
+ bar
+
+ & foo
+ bar
+
+ | foo
+ bar
+
+ ^ foo
+ bar
+
+ && foo
+ bar
+
+ || foo
+ bar
+
+ < foo
+ bar
+
+ > foo
+ bar
+
diff --git a/test/indent/rust/line-start-with-operator/rc b/test/indent/rust/line-start-with-operator/rc
new file mode 100644
index 00000000..64064c25
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/rc
@@ -0,0 +1,3 @@
+source "%val{runtime}/colors/default.kak"
+source "%val{runtime}/rc/filetype/rust.kak"
+set buffer filetype rust