From 46ea52a0a81a1f4bd1e89df9e5d68be9d08acafa Mon Sep 17 00:00:00 2001 From: John Isom Date: Sun, 26 Jul 2020 12:21:07 -0600 Subject: Add test cases for c-family closing brace indentation --- .../c-family/deindent-function-closing-brace/cmd | 1 + .../c-family/deindent-function-closing-brace/in | 12 ++++++++ .../c-family/deindent-function-closing-brace/out | 17 +++++++++++ .../c-family/deindent-function-closing-brace/rc | 3 ++ .../c-family/deindent-generic-closing-brace/cmd | 1 + .../c-family/deindent-generic-closing-brace/in | 25 ++++++++++++++++ .../c-family/deindent-generic-closing-brace/out | 35 ++++++++++++++++++++++ .../c-family/deindent-generic-closing-brace/rc | 3 ++ test/indent/c-family/deindent-if-closing-brace/cmd | 1 + test/indent/c-family/deindent-if-closing-brace/in | 12 ++++++++ test/indent/c-family/deindent-if-closing-brace/out | 17 +++++++++++ test/indent/c-family/deindent-if-closing-brace/rc | 3 ++ 12 files changed, 130 insertions(+) create mode 100644 test/indent/c-family/deindent-function-closing-brace/cmd create mode 100644 test/indent/c-family/deindent-function-closing-brace/in create mode 100644 test/indent/c-family/deindent-function-closing-brace/out create mode 100644 test/indent/c-family/deindent-function-closing-brace/rc create mode 100644 test/indent/c-family/deindent-generic-closing-brace/cmd create mode 100644 test/indent/c-family/deindent-generic-closing-brace/in create mode 100644 test/indent/c-family/deindent-generic-closing-brace/out create mode 100644 test/indent/c-family/deindent-generic-closing-brace/rc create mode 100644 test/indent/c-family/deindent-if-closing-brace/cmd create mode 100644 test/indent/c-family/deindent-if-closing-brace/in create mode 100644 test/indent/c-family/deindent-if-closing-brace/out create mode 100644 test/indent/c-family/deindent-if-closing-brace/rc (limited to 'test') diff --git a/test/indent/c-family/deindent-function-closing-brace/cmd b/test/indent/c-family/deindent-function-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/c-family/deindent-function-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/c-family/deindent-function-closing-brace/in b/test/indent/c-family/deindent-function-closing-brace/in new file mode 100644 index 00000000..34193ba9 --- /dev/null +++ b/test/indent/c-family/deindent-function-closing-brace/in @@ -0,0 +1,12 @@ +void foo(void) {%( )} + +void foo(void) {%( ) +} + +void foo(void) {%( )bar()} + +void foo(void) {%( )bar() +} + +void foo(void) { + bar()%( )} diff --git a/test/indent/c-family/deindent-function-closing-brace/out b/test/indent/c-family/deindent-function-closing-brace/out new file mode 100644 index 00000000..827927d0 --- /dev/null +++ b/test/indent/c-family/deindent-function-closing-brace/out @@ -0,0 +1,17 @@ +void foo(void) { +} + +void foo(void) { + +} + +void foo(void) { + bar()} + +void foo(void) { + bar() +} + +void foo(void) { + bar() +} diff --git a/test/indent/c-family/deindent-function-closing-brace/rc b/test/indent/c-family/deindent-function-closing-brace/rc new file mode 100644 index 00000000..2c2a7247 --- /dev/null +++ b/test/indent/c-family/deindent-function-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/c-family.kak" +set buffer filetype cpp diff --git a/test/indent/c-family/deindent-generic-closing-brace/cmd b/test/indent/c-family/deindent-generic-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/c-family/deindent-generic-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/c-family/deindent-generic-closing-brace/in b/test/indent/c-family/deindent-generic-closing-brace/in new file mode 100644 index 00000000..b2f7c26d --- /dev/null +++ b/test/indent/c-family/deindent-generic-closing-brace/in @@ -0,0 +1,25 @@ +{%( )} + +{%( ) +} + +{%( )bar()} + +{%( )bar() +} + +{ + bar()%( )} + +{(%( ))} + +{(%( ) +)} + +{(%( )foo())} + +{(%( )foo() +)} + +{( + bar()%( ))} diff --git a/test/indent/c-family/deindent-generic-closing-brace/out b/test/indent/c-family/deindent-generic-closing-brace/out new file mode 100644 index 00000000..58109817 --- /dev/null +++ b/test/indent/c-family/deindent-generic-closing-brace/out @@ -0,0 +1,35 @@ +{ +} + +{ + +} + +{ + bar()} + +{ + bar() +} + +{ + bar() +} + +{( +)} + +{( + +)} + +{( + foo())} + +{( + foo() +)} + +{( + bar() +)} diff --git a/test/indent/c-family/deindent-generic-closing-brace/rc b/test/indent/c-family/deindent-generic-closing-brace/rc new file mode 100644 index 00000000..2c2a7247 --- /dev/null +++ b/test/indent/c-family/deindent-generic-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/c-family.kak" +set buffer filetype cpp diff --git a/test/indent/c-family/deindent-if-closing-brace/cmd b/test/indent/c-family/deindent-if-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/c-family/deindent-if-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/c-family/deindent-if-closing-brace/in b/test/indent/c-family/deindent-if-closing-brace/in new file mode 100644 index 00000000..8d46bc97 --- /dev/null +++ b/test/indent/c-family/deindent-if-closing-brace/in @@ -0,0 +1,12 @@ +if (1) {%( )} + +if (1) {%( ) +} + +if (1) {%( )bar()} + +if (1) {%( )bar() +} + +if (1) { + bar()%( )} diff --git a/test/indent/c-family/deindent-if-closing-brace/out b/test/indent/c-family/deindent-if-closing-brace/out new file mode 100644 index 00000000..df0b059e --- /dev/null +++ b/test/indent/c-family/deindent-if-closing-brace/out @@ -0,0 +1,17 @@ +if (1) { +} + +if (1) { + +} + +if (1) { + bar()} + +if (1) { + bar() +} + +if (1) { + bar() +} diff --git a/test/indent/c-family/deindent-if-closing-brace/rc b/test/indent/c-family/deindent-if-closing-brace/rc new file mode 100644 index 00000000..2c2a7247 --- /dev/null +++ b/test/indent/c-family/deindent-if-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/c-family.kak" +set buffer filetype cpp -- cgit v1.2.3 From d2437b468d600c68f9c7736454888d2045eb16dd Mon Sep 17 00:00:00 2001 From: John Isom Date: Sun, 26 Jul 2020 20:01:50 -0600 Subject: Add test cases for rust closing brace indentation --- .../rust/deindent-function-closing-brace/cmd | 1 + .../indent/rust/deindent-function-closing-brace/in | 12 ++++++++ .../rust/deindent-function-closing-brace/out | 17 +++++++++++ .../indent/rust/deindent-function-closing-brace/rc | 3 ++ .../indent/rust/deindent-generic-closing-brace/cmd | 1 + test/indent/rust/deindent-generic-closing-brace/in | 25 ++++++++++++++++ .../indent/rust/deindent-generic-closing-brace/out | 35 ++++++++++++++++++++++ test/indent/rust/deindent-generic-closing-brace/rc | 3 ++ test/indent/rust/deindent-if-closing-brace/cmd | 1 + test/indent/rust/deindent-if-closing-brace/in | 12 ++++++++ test/indent/rust/deindent-if-closing-brace/out | 17 +++++++++++ test/indent/rust/deindent-if-closing-brace/rc | 3 ++ 12 files changed, 130 insertions(+) create mode 100644 test/indent/rust/deindent-function-closing-brace/cmd create mode 100644 test/indent/rust/deindent-function-closing-brace/in create mode 100644 test/indent/rust/deindent-function-closing-brace/out create mode 100644 test/indent/rust/deindent-function-closing-brace/rc create mode 100644 test/indent/rust/deindent-generic-closing-brace/cmd create mode 100644 test/indent/rust/deindent-generic-closing-brace/in create mode 100644 test/indent/rust/deindent-generic-closing-brace/out create mode 100644 test/indent/rust/deindent-generic-closing-brace/rc create mode 100644 test/indent/rust/deindent-if-closing-brace/cmd create mode 100644 test/indent/rust/deindent-if-closing-brace/in create mode 100644 test/indent/rust/deindent-if-closing-brace/out create mode 100644 test/indent/rust/deindent-if-closing-brace/rc (limited to 'test') diff --git a/test/indent/rust/deindent-function-closing-brace/cmd b/test/indent/rust/deindent-function-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/rust/deindent-function-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/rust/deindent-function-closing-brace/in b/test/indent/rust/deindent-function-closing-brace/in new file mode 100644 index 00000000..63c8bb53 --- /dev/null +++ b/test/indent/rust/deindent-function-closing-brace/in @@ -0,0 +1,12 @@ +fn foo() -> i32 {%( )} + +fn foo() -> i32 {%( ) +} + +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 new file mode 100644 index 00000000..1a887315 --- /dev/null +++ b/test/indent/rust/deindent-function-closing-brace/out @@ -0,0 +1,17 @@ +fn foo() -> i32 { +} + +fn foo() -> i32 { + +} + +fn foo() -> i32 { + bar()} + +fn foo() -> i32 { + bar() +} + +fn foo() -> i32 { + bar() +} diff --git a/test/indent/rust/deindent-function-closing-brace/rc b/test/indent/rust/deindent-function-closing-brace/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/deindent-function-closing-brace/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/deindent-generic-closing-brace/cmd b/test/indent/rust/deindent-generic-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/rust/deindent-generic-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/rust/deindent-generic-closing-brace/in b/test/indent/rust/deindent-generic-closing-brace/in new file mode 100644 index 00000000..b2f7c26d --- /dev/null +++ b/test/indent/rust/deindent-generic-closing-brace/in @@ -0,0 +1,25 @@ +{%( )} + +{%( ) +} + +{%( )bar()} + +{%( )bar() +} + +{ + bar()%( )} + +{(%( ))} + +{(%( ) +)} + +{(%( )foo())} + +{(%( )foo() +)} + +{( + bar()%( ))} diff --git a/test/indent/rust/deindent-generic-closing-brace/out b/test/indent/rust/deindent-generic-closing-brace/out new file mode 100644 index 00000000..58109817 --- /dev/null +++ b/test/indent/rust/deindent-generic-closing-brace/out @@ -0,0 +1,35 @@ +{ +} + +{ + +} + +{ + bar()} + +{ + bar() +} + +{ + bar() +} + +{( +)} + +{( + +)} + +{( + foo())} + +{( + foo() +)} + +{( + bar() +)} diff --git a/test/indent/rust/deindent-generic-closing-brace/rc b/test/indent/rust/deindent-generic-closing-brace/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/deindent-generic-closing-brace/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/deindent-if-closing-brace/cmd b/test/indent/rust/deindent-if-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/rust/deindent-if-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/rust/deindent-if-closing-brace/in b/test/indent/rust/deindent-if-closing-brace/in new file mode 100644 index 00000000..d5f59de0 --- /dev/null +++ b/test/indent/rust/deindent-if-closing-brace/in @@ -0,0 +1,12 @@ +if true {%( )} + +if true {%( ) +} + +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 new file mode 100644 index 00000000..2c63bd1c --- /dev/null +++ b/test/indent/rust/deindent-if-closing-brace/out @@ -0,0 +1,17 @@ +if true { +} + +if true { + +} + +if true { + bar()} + +if true { + bar() +} + +if true { + bar() +} diff --git a/test/indent/rust/deindent-if-closing-brace/rc b/test/indent/rust/deindent-if-closing-brace/rc new file mode 100644 index 00000000..64064c25 --- /dev/null +++ b/test/indent/rust/deindent-if-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/rust.kak" +set buffer filetype rust -- cgit v1.2.3 From 043912800775c40ef6ef4b371431e48c5bc147f1 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sun, 26 Jul 2020 20:28:33 -0600 Subject: Add test cases for go closing brace indentation --- test/indent/go/deindent-function-closing-brace/cmd | 1 + test/indent/go/deindent-function-closing-brace/in | 12 ++++++++ test/indent/go/deindent-function-closing-brace/out | 17 +++++++++++ test/indent/go/deindent-function-closing-brace/rc | 3 ++ test/indent/go/deindent-generic-closing-brace/cmd | 1 + test/indent/go/deindent-generic-closing-brace/in | 25 ++++++++++++++++ test/indent/go/deindent-generic-closing-brace/out | 35 ++++++++++++++++++++++ test/indent/go/deindent-generic-closing-brace/rc | 3 ++ test/indent/go/deindent-if-closing-brace/cmd | 1 + test/indent/go/deindent-if-closing-brace/in | 12 ++++++++ test/indent/go/deindent-if-closing-brace/out | 17 +++++++++++ test/indent/go/deindent-if-closing-brace/rc | 3 ++ 12 files changed, 130 insertions(+) create mode 100644 test/indent/go/deindent-function-closing-brace/cmd create mode 100644 test/indent/go/deindent-function-closing-brace/in create mode 100644 test/indent/go/deindent-function-closing-brace/out create mode 100644 test/indent/go/deindent-function-closing-brace/rc create mode 100644 test/indent/go/deindent-generic-closing-brace/cmd create mode 100644 test/indent/go/deindent-generic-closing-brace/in create mode 100644 test/indent/go/deindent-generic-closing-brace/out create mode 100644 test/indent/go/deindent-generic-closing-brace/rc create mode 100644 test/indent/go/deindent-if-closing-brace/cmd create mode 100644 test/indent/go/deindent-if-closing-brace/in create mode 100644 test/indent/go/deindent-if-closing-brace/out create mode 100644 test/indent/go/deindent-if-closing-brace/rc (limited to 'test') diff --git a/test/indent/go/deindent-function-closing-brace/cmd b/test/indent/go/deindent-function-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/go/deindent-function-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/go/deindent-function-closing-brace/in b/test/indent/go/deindent-function-closing-brace/in new file mode 100644 index 00000000..6c56be4e --- /dev/null +++ b/test/indent/go/deindent-function-closing-brace/in @@ -0,0 +1,12 @@ +func foo(x int) int {%( )} + +func foo(x int) int {%( ) +} + +func foo(x int) int {%( )bar()} + +func foo(x int) int {%( )bar() +} + +func foo(x int) int { + bar()%( )} diff --git a/test/indent/go/deindent-function-closing-brace/out b/test/indent/go/deindent-function-closing-brace/out new file mode 100644 index 00000000..a5a15ced --- /dev/null +++ b/test/indent/go/deindent-function-closing-brace/out @@ -0,0 +1,17 @@ +func foo(x int) int { +} + +func foo(x int) int { + +} + +func foo(x int) int { + bar()} + +func foo(x int) int { + bar() +} + +func foo(x int) int { + bar() +} diff --git a/test/indent/go/deindent-function-closing-brace/rc b/test/indent/go/deindent-function-closing-brace/rc new file mode 100644 index 00000000..1b0b0035 --- /dev/null +++ b/test/indent/go/deindent-function-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/go.kak" +set buffer filetype go diff --git a/test/indent/go/deindent-generic-closing-brace/cmd b/test/indent/go/deindent-generic-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/go/deindent-generic-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/go/deindent-generic-closing-brace/in b/test/indent/go/deindent-generic-closing-brace/in new file mode 100644 index 00000000..b2f7c26d --- /dev/null +++ b/test/indent/go/deindent-generic-closing-brace/in @@ -0,0 +1,25 @@ +{%( )} + +{%( ) +} + +{%( )bar()} + +{%( )bar() +} + +{ + bar()%( )} + +{(%( ))} + +{(%( ) +)} + +{(%( )foo())} + +{(%( )foo() +)} + +{( + bar()%( ))} diff --git a/test/indent/go/deindent-generic-closing-brace/out b/test/indent/go/deindent-generic-closing-brace/out new file mode 100644 index 00000000..58109817 --- /dev/null +++ b/test/indent/go/deindent-generic-closing-brace/out @@ -0,0 +1,35 @@ +{ +} + +{ + +} + +{ + bar()} + +{ + bar() +} + +{ + bar() +} + +{( +)} + +{( + +)} + +{( + foo())} + +{( + foo() +)} + +{( + bar() +)} diff --git a/test/indent/go/deindent-generic-closing-brace/rc b/test/indent/go/deindent-generic-closing-brace/rc new file mode 100644 index 00000000..1b0b0035 --- /dev/null +++ b/test/indent/go/deindent-generic-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/go.kak" +set buffer filetype go diff --git a/test/indent/go/deindent-if-closing-brace/cmd b/test/indent/go/deindent-if-closing-brace/cmd new file mode 100644 index 00000000..e3036a40 --- /dev/null +++ b/test/indent/go/deindent-if-closing-brace/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/go/deindent-if-closing-brace/in b/test/indent/go/deindent-if-closing-brace/in new file mode 100644 index 00000000..d5f59de0 --- /dev/null +++ b/test/indent/go/deindent-if-closing-brace/in @@ -0,0 +1,12 @@ +if true {%( )} + +if true {%( ) +} + +if true {%( )bar()} + +if true {%( )bar() +} + +if true { + bar()%( )} diff --git a/test/indent/go/deindent-if-closing-brace/out b/test/indent/go/deindent-if-closing-brace/out new file mode 100644 index 00000000..2c63bd1c --- /dev/null +++ b/test/indent/go/deindent-if-closing-brace/out @@ -0,0 +1,17 @@ +if true { +} + +if true { + +} + +if true { + bar()} + +if true { + bar() +} + +if true { + bar() +} diff --git a/test/indent/go/deindent-if-closing-brace/rc b/test/indent/go/deindent-if-closing-brace/rc new file mode 100644 index 00000000..1b0b0035 --- /dev/null +++ b/test/indent/go/deindent-if-closing-brace/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/go.kak" +set buffer filetype go -- cgit v1.2.3 From 2e6e507d4217c836e1b0eeb57f656f103c7ba75f Mon Sep 17 00:00:00 2001 From: John Isom Date: Mon, 27 Jul 2020 11:58:01 -0600 Subject: Add c-family test cases for bad indentation edge case --- test/indent/c-family/deindent-function-closing-brace/in | 3 +++ test/indent/c-family/deindent-function-closing-brace/out | 4 ++++ test/indent/c-family/deindent-generic-closing-brace/in | 6 ++++++ test/indent/c-family/deindent-generic-closing-brace/out | 8 ++++++++ test/indent/c-family/deindent-if-closing-brace/in | 3 +++ test/indent/c-family/deindent-if-closing-brace/out | 4 ++++ 6 files changed, 28 insertions(+) (limited to 'test') diff --git a/test/indent/c-family/deindent-function-closing-brace/in b/test/indent/c-family/deindent-function-closing-brace/in index 34193ba9..732f00da 100644 --- a/test/indent/c-family/deindent-function-closing-brace/in +++ b/test/indent/c-family/deindent-function-closing-brace/in @@ -10,3 +10,6 @@ void foo(void) {%( )bar() void foo(void) { bar()%( )} + + void foo(void) { + bar()%( )} diff --git a/test/indent/c-family/deindent-function-closing-brace/out b/test/indent/c-family/deindent-function-closing-brace/out index 827927d0..b507fbee 100644 --- a/test/indent/c-family/deindent-function-closing-brace/out +++ b/test/indent/c-family/deindent-function-closing-brace/out @@ -15,3 +15,7 @@ void foo(void) { void foo(void) { bar() } + + void foo(void) { + bar() + } diff --git a/test/indent/c-family/deindent-generic-closing-brace/in b/test/indent/c-family/deindent-generic-closing-brace/in index b2f7c26d..d7e7a23d 100644 --- a/test/indent/c-family/deindent-generic-closing-brace/in +++ b/test/indent/c-family/deindent-generic-closing-brace/in @@ -23,3 +23,9 @@ {( bar()%( ))} + + { + bar()%( )} + + {( + bar()%( ))} diff --git a/test/indent/c-family/deindent-generic-closing-brace/out b/test/indent/c-family/deindent-generic-closing-brace/out index 58109817..d00507c9 100644 --- a/test/indent/c-family/deindent-generic-closing-brace/out +++ b/test/indent/c-family/deindent-generic-closing-brace/out @@ -33,3 +33,11 @@ {( bar() )} + + { + bar() + } + + {( + bar() + )} diff --git a/test/indent/c-family/deindent-if-closing-brace/in b/test/indent/c-family/deindent-if-closing-brace/in index 8d46bc97..5ac38a34 100644 --- a/test/indent/c-family/deindent-if-closing-brace/in +++ b/test/indent/c-family/deindent-if-closing-brace/in @@ -10,3 +10,6 @@ if (1) {%( )bar() if (1) { bar()%( )} + + if (1) { + bar()%( )} diff --git a/test/indent/c-family/deindent-if-closing-brace/out b/test/indent/c-family/deindent-if-closing-brace/out index df0b059e..d46b84cf 100644 --- a/test/indent/c-family/deindent-if-closing-brace/out +++ b/test/indent/c-family/deindent-if-closing-brace/out @@ -15,3 +15,7 @@ if (1) { if (1) { bar() } + + if (1) { + bar() + } -- cgit v1.2.3 From 26f4681c3bc7462184accb06d78c4d5ea9082e3a Mon Sep 17 00:00:00 2001 From: John Isom Date: Mon, 27 Jul 2020 12:13:23 -0600 Subject: 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(+) (limited to 'test') 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() + } -- cgit v1.2.3 From 504d3098940a5b3bc3ed407c2d0c3c3f4944ecdf Mon Sep 17 00:00:00 2001 From: John Isom Date: Mon, 27 Jul 2020 12:18:40 -0600 Subject: Add go test cases for bad indentation edge case --- test/indent/go/deindent-function-closing-brace/in | 3 +++ test/indent/go/deindent-function-closing-brace/out | 4 ++++ test/indent/go/deindent-generic-closing-brace/in | 6 ++++++ test/indent/go/deindent-generic-closing-brace/out | 8 ++++++++ 4 files changed, 21 insertions(+) (limited to 'test') diff --git a/test/indent/go/deindent-function-closing-brace/in b/test/indent/go/deindent-function-closing-brace/in index 6c56be4e..a30bf4c4 100644 --- a/test/indent/go/deindent-function-closing-brace/in +++ b/test/indent/go/deindent-function-closing-brace/in @@ -10,3 +10,6 @@ func foo(x int) int {%( )bar() func foo(x int) int { bar()%( )} + + func foo(x int) int { + bar()%( )} diff --git a/test/indent/go/deindent-function-closing-brace/out b/test/indent/go/deindent-function-closing-brace/out index a5a15ced..3a5e4869 100644 --- a/test/indent/go/deindent-function-closing-brace/out +++ b/test/indent/go/deindent-function-closing-brace/out @@ -15,3 +15,7 @@ func foo(x int) int { func foo(x int) int { bar() } + + func foo(x int) int { + bar() + } diff --git a/test/indent/go/deindent-generic-closing-brace/in b/test/indent/go/deindent-generic-closing-brace/in index b2f7c26d..5a31c18f 100644 --- a/test/indent/go/deindent-generic-closing-brace/in +++ b/test/indent/go/deindent-generic-closing-brace/in @@ -11,6 +11,9 @@ { bar()%( )} + { + bar()%( )} + {(%( ))} {(%( ) @@ -23,3 +26,6 @@ {( bar()%( ))} + + {( + bar()%( ))} diff --git a/test/indent/go/deindent-generic-closing-brace/out b/test/indent/go/deindent-generic-closing-brace/out index 58109817..cfd6db40 100644 --- a/test/indent/go/deindent-generic-closing-brace/out +++ b/test/indent/go/deindent-generic-closing-brace/out @@ -16,6 +16,10 @@ bar() } + { + bar() + } + {( )} @@ -33,3 +37,7 @@ {( bar() )} + + {( + bar() + )} -- cgit v1.2.3 From 428232d2fa920c57b0213f0b208ea5aac3f7c11c Mon Sep 17 00:00:00 2001 From: John Isom Date: Wed, 29 Jul 2020 15:05:49 -0600 Subject: Add tests for javascript deindenting --- test/indent/javascript/deindent-complex-brace-structure/cmd | 1 + test/indent/javascript/deindent-complex-brace-structure/in | 1 + test/indent/javascript/deindent-complex-brace-structure/out | 12 ++++++++++++ test/indent/javascript/deindent-complex-brace-structure/rc | 3 +++ 4 files changed, 17 insertions(+) create mode 100644 test/indent/javascript/deindent-complex-brace-structure/cmd create mode 100644 test/indent/javascript/deindent-complex-brace-structure/in create mode 100644 test/indent/javascript/deindent-complex-brace-structure/out create mode 100644 test/indent/javascript/deindent-complex-brace-structure/rc (limited to 'test') diff --git a/test/indent/javascript/deindent-complex-brace-structure/cmd b/test/indent/javascript/deindent-complex-brace-structure/cmd new file mode 100644 index 00000000..f9bfe77d --- /dev/null +++ b/test/indent/javascript/deindent-complex-brace-structure/cmd @@ -0,0 +1 @@ +cOif (true) {}hiOconsole.log();hhiO{},{},hhi1Ofoo: { bar: 1 },jjobaz: { bam: 2 }, diff --git a/test/indent/javascript/deindent-complex-brace-structure/in b/test/indent/javascript/deindent-complex-brace-structure/in new file mode 100644 index 00000000..0f89c5b3 --- /dev/null +++ b/test/indent/javascript/deindent-complex-brace-structure/in @@ -0,0 +1 @@ +for (let i = 1; i < 5; ++i) {%( )} diff --git a/test/indent/javascript/deindent-complex-brace-structure/out b/test/indent/javascript/deindent-complex-brace-structure/out new file mode 100644 index 00000000..1d675934 --- /dev/null +++ b/test/indent/javascript/deindent-complex-brace-structure/out @@ -0,0 +1,12 @@ +for (let i = 1; i < 5; ++i) { + if (true) { + console.log( + { + foo: { bar: 1 }, + }, + { + baz: { bam: 2 }, + }, + ); + } +} diff --git a/test/indent/javascript/deindent-complex-brace-structure/rc b/test/indent/javascript/deindent-complex-brace-structure/rc new file mode 100644 index 00000000..c975d253 --- /dev/null +++ b/test/indent/javascript/deindent-complex-brace-structure/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/javascript.kak" +set buffer filetype javascript -- cgit v1.2.3