summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el38
1 files changed, 38 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 524d474..e8be519 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -425,6 +425,44 @@ fn foo()
"
))
+(ert-deftest indent-match ()
+ (test-indent
+ "
+fn foo() {
+ match blah {
+ Pattern => stuff(),
+ _ => whatever
+ }
+}
+"
+ ))
+
+(ert-deftest indent-match-multiline-pattern ()
+ (test-indent
+ "
+fn foo() {
+ match blah {
+ Pattern |
+ Pattern2 => {
+ hello()
+ },
+ _ => whatever
+ }
+}
+"
+ ))
+
+;; Make sure that in effort to cover match patterns we don't mistreat || or expressions
+(ert-deftest indent-nonmatch-or-expression ()
+ (test-indent
+ "
+fn foo() {
+ let x = foo() ||
+ bar();
+}
+"
+ ))
+
(setq rust-test-motion-string
"
fn fn1(arg: int) -> bool {