summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-10-01 19:07:05 +1000
committerMaxime Coste <mawww@kakoune.org>2020-10-01 19:07:05 +1000
commitfcabffefe1e489805d680c20b1139be06d4020ca (patch)
treeb98c5d03e2cdc1b3135917b75aab9e56c291c7d2 /test
parent88f6b65f35fdd62313acf80f2aa67d56c8a335c2 (diff)
parentbfca07da4d52b821c67a5b4e3eb056df9d98bd55 (diff)
Merge remote-tracking branch 'pickfire/rust-indent' into master
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/before-where/cmd1
-rw-r--r--test/indent/rust/before-where/in2
-rw-r--r--test/indent/rust/before-where/out4
-rw-r--r--test/indent/rust/before-where/rc3
-rw-r--r--test/indent/rust/empty-line/cmd1
-rw-r--r--test/indent/rust/empty-line/in2
-rw-r--r--test/indent/rust/empty-line/out3
-rw-r--r--test/indent/rust/empty-line/rc3
-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/in28
-rw-r--r--test/indent/rust/line-start-with-operator/out42
-rw-r--r--test/indent/rust/line-start-with-operator/rc3
-rw-r--r--test/indent/rust/on-open-paren/in9
-rw-r--r--test/indent/rust/on-open-paren/out9
21 files changed, 166 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/before-where/cmd b/test/indent/rust/before-where/cmd
new file mode 100644
index 00000000..fe3daa48
--- /dev/null
+++ b/test/indent/rust/before-where/cmd
@@ -0,0 +1 @@
+c<ret>where<ret>bar<esc>
diff --git a/test/indent/rust/before-where/in b/test/indent/rust/before-where/in
new file mode 100644
index 00000000..0c1161c1
--- /dev/null
+++ b/test/indent/rust/before-where/in
@@ -0,0 +1,2 @@
+ impl X for T%( )
+
diff --git a/test/indent/rust/before-where/out b/test/indent/rust/before-where/out
new file mode 100644
index 00000000..caa373e4
--- /dev/null
+++ b/test/indent/rust/before-where/out
@@ -0,0 +1,4 @@
+ impl X for T
+ where
+ bar
+
diff --git a/test/indent/rust/before-where/rc b/test/indent/rust/before-where/rc
new file mode 100644
index 00000000..64064c25
--- /dev/null
+++ b/test/indent/rust/before-where/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/empty-line/cmd b/test/indent/rust/empty-line/cmd
new file mode 100644
index 00000000..8682d51e
--- /dev/null
+++ b/test/indent/rust/empty-line/cmd
@@ -0,0 +1 @@
+c<ret>bar<esc>
diff --git a/test/indent/rust/empty-line/in b/test/indent/rust/empty-line/in
new file mode 100644
index 00000000..e4ed2188
--- /dev/null
+++ b/test/indent/rust/empty-line/in
@@ -0,0 +1,2 @@
+ %( )
+
diff --git a/test/indent/rust/empty-line/out b/test/indent/rust/empty-line/out
new file mode 100644
index 00000000..4567eae7
--- /dev/null
+++ b/test/indent/rust/empty-line/out
@@ -0,0 +1,3 @@
+
+ bar
+
diff --git a/test/indent/rust/empty-line/rc b/test/indent/rust/empty-line/rc
new file mode 100644
index 00000000..64064c25
--- /dev/null
+++ b/test/indent/rust/empty-line/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/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..063f771e
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/in
@@ -0,0 +1,28 @@
+ .foo%( )
+
+ .foo()%( )
+
+ + foo%( )
+
+ - foo%( )
+
+ * foo%( )
+
+ / foo%( )
+
+ & foo%( )
+
+ | foo%( )
+
+ ^ foo%( )
+
+ && foo%( )
+
+ || foo%( )
+
+ < foo%( )
+
+ > foo%( )
+
+ #[derive(Debug)]%( )
+
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..f270d0d9
--- /dev/null
+++ b/test/indent/rust/line-start-with-operator/out
@@ -0,0 +1,42 @@
+ .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
+
+ #[derive(Debug)]
+ 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
diff --git a/test/indent/rust/on-open-paren/in b/test/indent/rust/on-open-paren/in
index 1ca71d62..661f2331 100644
--- a/test/indent/rust/on-open-paren/in
+++ b/test/indent/rust/on-open-paren/in
@@ -33,3 +33,12 @@
union X<T> where T: Debug %( )
+ if foo()
+ && bar()
+ %( )
+
+ for x in group
+ .iter()
+ .sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
+ %( )
+
diff --git a/test/indent/rust/on-open-paren/out b/test/indent/rust/on-open-paren/out
index de125ea7..60973f8a 100644
--- a/test/indent/rust/on-open-paren/out
+++ b/test/indent/rust/on-open-paren/out
@@ -33,3 +33,12 @@
union X<T> where T: Debug {
+ if foo()
+ && bar()
+ {
+
+ for x in group
+ .iter()
+ .sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
+ {
+