From 043912800775c40ef6ef4b371431e48c5bc147f1 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sun, 26 Jul 2020 20:28:33 -0600 Subject: [PATCH] Add test cases for go closing brace indentation --- .../go/deindent-function-closing-brace/cmd | 1 + .../go/deindent-function-closing-brace/in | 12 +++++++ .../go/deindent-function-closing-brace/out | 17 +++++++++ .../go/deindent-function-closing-brace/rc | 3 ++ .../go/deindent-generic-closing-brace/cmd | 1 + .../go/deindent-generic-closing-brace/in | 25 +++++++++++++ .../go/deindent-generic-closing-brace/out | 35 +++++++++++++++++++ .../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 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