From 26f4681c3bc7462184accb06d78c4d5ea9082e3a Mon Sep 17 00:00:00 2001 From: John Isom Date: Mon, 27 Jul 2020 12:13:23 -0600 Subject: [PATCH] Add rust test cases for bad indentation edge case --- test/indent/rust/deindent-function-closing-brace/in | 3 +++ test/indent/rust/deindent-function-closing-brace/out | 4 ++++ test/indent/rust/deindent-generic-closing-brace/in | 6 ++++++ test/indent/rust/deindent-generic-closing-brace/out | 8 ++++++++ test/indent/rust/deindent-if-closing-brace/in | 3 +++ test/indent/rust/deindent-if-closing-brace/out | 4 ++++ 6 files changed, 28 insertions(+) diff --git a/test/indent/rust/deindent-function-closing-brace/in b/test/indent/rust/deindent-function-closing-brace/in index 63c8bb53..ab5cc032 100644 --- a/test/indent/rust/deindent-function-closing-brace/in +++ b/test/indent/rust/deindent-function-closing-brace/in @@ -10,3 +10,6 @@ fn foo() -> i32 {%( )bar() fn foo() -> i32 { bar()%( )} + + fn foo() -> i32 { + bar()%( )} diff --git a/test/indent/rust/deindent-function-closing-brace/out b/test/indent/rust/deindent-function-closing-brace/out index 1a887315..2c58c554 100644 --- a/test/indent/rust/deindent-function-closing-brace/out +++ b/test/indent/rust/deindent-function-closing-brace/out @@ -15,3 +15,7 @@ fn foo() -> i32 { fn foo() -> i32 { bar() } + + fn foo() -> i32 { + bar() + } diff --git a/test/indent/rust/deindent-generic-closing-brace/in b/test/indent/rust/deindent-generic-closing-brace/in index b2f7c26d..21109831 100644 --- a/test/indent/rust/deindent-generic-closing-brace/in +++ b/test/indent/rust/deindent-generic-closing-brace/in @@ -11,6 +11,9 @@ { bar()%( )} + { + bar()%( )} + {(%( ))} {(%( ) @@ -23,3 +26,6 @@ {( bar()%( ))} + + {( + bar()%( ))} diff --git a/test/indent/rust/deindent-generic-closing-brace/out b/test/indent/rust/deindent-generic-closing-brace/out index 58109817..c8615372 100644 --- a/test/indent/rust/deindent-generic-closing-brace/out +++ b/test/indent/rust/deindent-generic-closing-brace/out @@ -16,6 +16,10 @@ bar() } + { + bar() + } + {( )} @@ -33,3 +37,7 @@ {( bar() )} + + {( + bar() + )} diff --git a/test/indent/rust/deindent-if-closing-brace/in b/test/indent/rust/deindent-if-closing-brace/in index d5f59de0..f26c5e62 100644 --- a/test/indent/rust/deindent-if-closing-brace/in +++ b/test/indent/rust/deindent-if-closing-brace/in @@ -10,3 +10,6 @@ if true {%( )bar() if true { bar()%( )} + + if true { + bar()%( )} diff --git a/test/indent/rust/deindent-if-closing-brace/out b/test/indent/rust/deindent-if-closing-brace/out index 2c63bd1c..1276abbe 100644 --- a/test/indent/rust/deindent-if-closing-brace/out +++ b/test/indent/rust/deindent-if-closing-brace/out @@ -15,3 +15,7 @@ if true { if true { bar() } + + if true { + bar() + }