From c5dd01323507a6baceaf44471cccdcecb45ac83a Mon Sep 17 00:00:00 2001 From: Simon Fowler Date: Sun, 30 Jun 2019 12:57:59 +1000 Subject: [PATCH] Add tests. Probably overkill, but at least this is comprehensive . . . --- test/indent/sh/deindent-after-done/cmd | 1 + test/indent/sh/deindent-after-done/in | 3 +++ test/indent/sh/deindent-after-done/out | 4 ++++ test/indent/sh/deindent-after-done/rc | 3 +++ test/indent/sh/deindent-after-esac/in | 5 +++++ test/indent/sh/deindent-after-esac/out | 6 ++++++ test/indent/sh/deindent-after-esac/rc | 3 +++ test/indent/sh/deindent-after-fi/cmd | 1 + test/indent/sh/deindent-after-fi/in | 2 ++ test/indent/sh/deindent-after-fi/out | 4 ++++ test/indent/sh/deindent-after-fi/rc | 3 +++ test/indent/sh/deindent-case-option/cmd | 1 + test/indent/sh/deindent-case-option/in | 5 +++++ test/indent/sh/deindent-case-option/out | 7 +++++++ test/indent/sh/deindent-case-option/rc | 3 +++ test/indent/sh/deindent-compound-command/cmd | 1 + test/indent/sh/deindent-compound-command/in | 3 +++ test/indent/sh/deindent-compound-command/out | 4 ++++ test/indent/sh/deindent-compound-command/rc | 3 +++ test/indent/sh/deindent-one-line-case-option/cmd | 1 + test/indent/sh/deindent-one-line-case-option/in | 2 ++ test/indent/sh/deindent-one-line-case-option/out | 3 +++ test/indent/sh/deindent-one-line-case-option/rc | 3 +++ test/indent/sh/deindent-only-else/cmd | 1 + test/indent/sh/deindent-only-else/in | 3 +++ test/indent/sh/deindent-only-else/out | 4 ++++ test/indent/sh/deindent-only-else/rc | 3 +++ test/indent/sh/indent-after-do/cmd | 1 + test/indent/sh/indent-after-do/in | 1 + test/indent/sh/indent-after-do/out | 2 ++ test/indent/sh/indent-after-do/rc | 3 +++ test/indent/sh/indent-after-in/cmd | 1 + test/indent/sh/indent-after-in/in | 1 + test/indent/sh/indent-after-in/out | 2 ++ test/indent/sh/indent-after-in/rc | 3 +++ test/indent/sh/indent-after-then/cmd | 1 + test/indent/sh/indent-after-then/in | 1 + test/indent/sh/indent-after-then/out | 2 ++ test/indent/sh/indent-after-then/rc | 3 +++ test/indent/sh/indent-block-case/cmd | 1 + test/indent/sh/indent-block-case/in | 3 +++ test/indent/sh/indent-block-case/out | 5 +++++ test/indent/sh/indent-block-case/rc | 3 +++ test/indent/sh/indent-compound-command/cmd | 1 + test/indent/sh/indent-compound-command/in | 1 + test/indent/sh/indent-compound-command/out | 2 ++ test/indent/sh/indent-compound-command/rc | 3 +++ 47 files changed, 122 insertions(+) create mode 100644 test/indent/sh/deindent-after-done/cmd create mode 100644 test/indent/sh/deindent-after-done/in create mode 100644 test/indent/sh/deindent-after-done/out create mode 100644 test/indent/sh/deindent-after-done/rc create mode 100644 test/indent/sh/deindent-after-esac/in create mode 100644 test/indent/sh/deindent-after-esac/out create mode 100644 test/indent/sh/deindent-after-esac/rc create mode 100644 test/indent/sh/deindent-after-fi/cmd create mode 100644 test/indent/sh/deindent-after-fi/in create mode 100644 test/indent/sh/deindent-after-fi/out create mode 100644 test/indent/sh/deindent-after-fi/rc create mode 100644 test/indent/sh/deindent-case-option/cmd create mode 100644 test/indent/sh/deindent-case-option/in create mode 100644 test/indent/sh/deindent-case-option/out create mode 100644 test/indent/sh/deindent-case-option/rc create mode 100644 test/indent/sh/deindent-compound-command/cmd create mode 100644 test/indent/sh/deindent-compound-command/in create mode 100644 test/indent/sh/deindent-compound-command/out create mode 100644 test/indent/sh/deindent-compound-command/rc create mode 100644 test/indent/sh/deindent-one-line-case-option/cmd create mode 100644 test/indent/sh/deindent-one-line-case-option/in create mode 100644 test/indent/sh/deindent-one-line-case-option/out create mode 100644 test/indent/sh/deindent-one-line-case-option/rc create mode 100644 test/indent/sh/deindent-only-else/cmd create mode 100644 test/indent/sh/deindent-only-else/in create mode 100644 test/indent/sh/deindent-only-else/out create mode 100644 test/indent/sh/deindent-only-else/rc create mode 100644 test/indent/sh/indent-after-do/cmd create mode 100644 test/indent/sh/indent-after-do/in create mode 100644 test/indent/sh/indent-after-do/out create mode 100644 test/indent/sh/indent-after-do/rc create mode 100644 test/indent/sh/indent-after-in/cmd create mode 100644 test/indent/sh/indent-after-in/in create mode 100644 test/indent/sh/indent-after-in/out create mode 100644 test/indent/sh/indent-after-in/rc create mode 100644 test/indent/sh/indent-after-then/cmd create mode 100644 test/indent/sh/indent-after-then/in create mode 100644 test/indent/sh/indent-after-then/out create mode 100644 test/indent/sh/indent-after-then/rc create mode 100644 test/indent/sh/indent-block-case/cmd create mode 100644 test/indent/sh/indent-block-case/in create mode 100644 test/indent/sh/indent-block-case/out create mode 100644 test/indent/sh/indent-block-case/rc create mode 100644 test/indent/sh/indent-compound-command/cmd create mode 100644 test/indent/sh/indent-compound-command/in create mode 100644 test/indent/sh/indent-compound-command/out create mode 100644 test/indent/sh/indent-compound-command/rc diff --git a/test/indent/sh/deindent-after-done/cmd b/test/indent/sh/deindent-after-done/cmd new file mode 100644 index 00000000..2bc67f43 --- /dev/null +++ b/test/indent/sh/deindent-after-done/cmd @@ -0,0 +1 @@ +gei diff --git a/test/indent/sh/deindent-after-done/in b/test/indent/sh/deindent-after-done/in new file mode 100644 index 00000000..aba22804 --- /dev/null +++ b/test/indent/sh/deindent-after-done/in @@ -0,0 +1,3 @@ +while true; do + thing1 + done diff --git a/test/indent/sh/deindent-after-done/out b/test/indent/sh/deindent-after-done/out new file mode 100644 index 00000000..029beac9 --- /dev/null +++ b/test/indent/sh/deindent-after-done/out @@ -0,0 +1,4 @@ +while true; do + thing1 +done + diff --git a/test/indent/sh/deindent-after-done/rc b/test/indent/sh/deindent-after-done/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-after-done/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-after-esac/in b/test/indent/sh/deindent-after-esac/in new file mode 100644 index 00000000..0264f173 --- /dev/null +++ b/test/indent/sh/deindent-after-esac/in @@ -0,0 +1,5 @@ +case $foo in + bar) + thing1 + thing2 + ;; diff --git a/test/indent/sh/deindent-after-esac/out b/test/indent/sh/deindent-after-esac/out new file mode 100644 index 00000000..39120039 --- /dev/null +++ b/test/indent/sh/deindent-after-esac/out @@ -0,0 +1,6 @@ +case $foo in + bar) + thing1 + thing2 + ;; +esac diff --git a/test/indent/sh/deindent-after-esac/rc b/test/indent/sh/deindent-after-esac/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-after-esac/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-after-fi/cmd b/test/indent/sh/deindent-after-fi/cmd new file mode 100644 index 00000000..edb2652b --- /dev/null +++ b/test/indent/sh/deindent-after-fi/cmd @@ -0,0 +1 @@ +geifi diff --git a/test/indent/sh/deindent-after-fi/in b/test/indent/sh/deindent-after-fi/in new file mode 100644 index 00000000..060389ab --- /dev/null +++ b/test/indent/sh/deindent-after-fi/in @@ -0,0 +1,2 @@ +if [ $foo ]; then + thing1 diff --git a/test/indent/sh/deindent-after-fi/out b/test/indent/sh/deindent-after-fi/out new file mode 100644 index 00000000..6df449ca --- /dev/null +++ b/test/indent/sh/deindent-after-fi/out @@ -0,0 +1,4 @@ +if [ $foo ]; then + thing1 +fi + diff --git a/test/indent/sh/deindent-after-fi/rc b/test/indent/sh/deindent-after-fi/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-after-fi/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-case-option/cmd b/test/indent/sh/deindent-case-option/cmd new file mode 100644 index 00000000..1a5f223e --- /dev/null +++ b/test/indent/sh/deindent-case-option/cmd @@ -0,0 +1 @@ +gei;;*) diff --git a/test/indent/sh/deindent-case-option/in b/test/indent/sh/deindent-case-option/in new file mode 100644 index 00000000..06c64dac --- /dev/null +++ b/test/indent/sh/deindent-case-option/in @@ -0,0 +1,5 @@ +case $foo in + bar) thing1;; + baz) + thing1 + thing2 diff --git a/test/indent/sh/deindent-case-option/out b/test/indent/sh/deindent-case-option/out new file mode 100644 index 00000000..7d9a6fa6 --- /dev/null +++ b/test/indent/sh/deindent-case-option/out @@ -0,0 +1,7 @@ +case $foo in + bar) thing1;; + baz) + thing1 + thing2 + ;; + *) diff --git a/test/indent/sh/deindent-case-option/rc b/test/indent/sh/deindent-case-option/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-case-option/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-compound-command/cmd b/test/indent/sh/deindent-compound-command/cmd new file mode 100644 index 00000000..2bc67f43 --- /dev/null +++ b/test/indent/sh/deindent-compound-command/cmd @@ -0,0 +1 @@ +gei diff --git a/test/indent/sh/deindent-compound-command/in b/test/indent/sh/deindent-compound-command/in new file mode 100644 index 00000000..a82d0f49 --- /dev/null +++ b/test/indent/sh/deindent-compound-command/in @@ -0,0 +1,3 @@ +foo () { + thing1 + } diff --git a/test/indent/sh/deindent-compound-command/out b/test/indent/sh/deindent-compound-command/out new file mode 100644 index 00000000..70841a6b --- /dev/null +++ b/test/indent/sh/deindent-compound-command/out @@ -0,0 +1,4 @@ +foo () { + thing1 +} + diff --git a/test/indent/sh/deindent-compound-command/rc b/test/indent/sh/deindent-compound-command/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-compound-command/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-one-line-case-option/cmd b/test/indent/sh/deindent-one-line-case-option/cmd new file mode 100644 index 00000000..22e45295 --- /dev/null +++ b/test/indent/sh/deindent-one-line-case-option/cmd @@ -0,0 +1 @@ +geibaz) diff --git a/test/indent/sh/deindent-one-line-case-option/in b/test/indent/sh/deindent-one-line-case-option/in new file mode 100644 index 00000000..08e8d55b --- /dev/null +++ b/test/indent/sh/deindent-one-line-case-option/in @@ -0,0 +1,2 @@ +case $foo in + bar) thing1;; diff --git a/test/indent/sh/deindent-one-line-case-option/out b/test/indent/sh/deindent-one-line-case-option/out new file mode 100644 index 00000000..b0d854a5 --- /dev/null +++ b/test/indent/sh/deindent-one-line-case-option/out @@ -0,0 +1,3 @@ +case $foo in + bar) thing1;; + baz) diff --git a/test/indent/sh/deindent-one-line-case-option/rc b/test/indent/sh/deindent-one-line-case-option/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-one-line-case-option/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/deindent-only-else/cmd b/test/indent/sh/deindent-only-else/cmd new file mode 100644 index 00000000..d6c743f9 --- /dev/null +++ b/test/indent/sh/deindent-only-else/cmd @@ -0,0 +1 @@ +geibaz diff --git a/test/indent/sh/deindent-only-else/in b/test/indent/sh/deindent-only-else/in new file mode 100644 index 00000000..8b287fd4 --- /dev/null +++ b/test/indent/sh/deindent-only-else/in @@ -0,0 +1,3 @@ +if [ $foo ]; then + bar + else diff --git a/test/indent/sh/deindent-only-else/out b/test/indent/sh/deindent-only-else/out new file mode 100644 index 00000000..75d8b0fa --- /dev/null +++ b/test/indent/sh/deindent-only-else/out @@ -0,0 +1,4 @@ +if [ $foo ]; then + bar +else + baz diff --git a/test/indent/sh/deindent-only-else/rc b/test/indent/sh/deindent-only-else/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/deindent-only-else/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/indent-after-do/cmd b/test/indent/sh/indent-after-do/cmd new file mode 100644 index 00000000..0bc4727f --- /dev/null +++ b/test/indent/sh/indent-after-do/cmd @@ -0,0 +1 @@ +geithing1 diff --git a/test/indent/sh/indent-after-do/in b/test/indent/sh/indent-after-do/in new file mode 100644 index 00000000..48ec3642 --- /dev/null +++ b/test/indent/sh/indent-after-do/in @@ -0,0 +1 @@ +while true; do diff --git a/test/indent/sh/indent-after-do/out b/test/indent/sh/indent-after-do/out new file mode 100644 index 00000000..210ac409 --- /dev/null +++ b/test/indent/sh/indent-after-do/out @@ -0,0 +1,2 @@ +while true; do + thing1 diff --git a/test/indent/sh/indent-after-do/rc b/test/indent/sh/indent-after-do/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/indent-after-do/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/indent-after-in/cmd b/test/indent/sh/indent-after-in/cmd new file mode 100644 index 00000000..e3f54ff4 --- /dev/null +++ b/test/indent/sh/indent-after-in/cmd @@ -0,0 +1 @@ +geibar) diff --git a/test/indent/sh/indent-after-in/in b/test/indent/sh/indent-after-in/in new file mode 100644 index 00000000..a94d1a3c --- /dev/null +++ b/test/indent/sh/indent-after-in/in @@ -0,0 +1 @@ +case $foo in diff --git a/test/indent/sh/indent-after-in/out b/test/indent/sh/indent-after-in/out new file mode 100644 index 00000000..a3be70a0 --- /dev/null +++ b/test/indent/sh/indent-after-in/out @@ -0,0 +1,2 @@ +case $foo in + bar) diff --git a/test/indent/sh/indent-after-in/rc b/test/indent/sh/indent-after-in/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/indent-after-in/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/indent-after-then/cmd b/test/indent/sh/indent-after-then/cmd new file mode 100644 index 00000000..0bc4727f --- /dev/null +++ b/test/indent/sh/indent-after-then/cmd @@ -0,0 +1 @@ +geithing1 diff --git a/test/indent/sh/indent-after-then/in b/test/indent/sh/indent-after-then/in new file mode 100644 index 00000000..c640fe4f --- /dev/null +++ b/test/indent/sh/indent-after-then/in @@ -0,0 +1 @@ +if [ $foo ]; then diff --git a/test/indent/sh/indent-after-then/out b/test/indent/sh/indent-after-then/out new file mode 100644 index 00000000..060389ab --- /dev/null +++ b/test/indent/sh/indent-after-then/out @@ -0,0 +1,2 @@ +if [ $foo ]; then + thing1 diff --git a/test/indent/sh/indent-after-then/rc b/test/indent/sh/indent-after-then/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/indent-after-then/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/indent-block-case/cmd b/test/indent/sh/indent-block-case/cmd new file mode 100644 index 00000000..3598c36a --- /dev/null +++ b/test/indent/sh/indent-block-case/cmd @@ -0,0 +1 @@ +geithing1thing2 diff --git a/test/indent/sh/indent-block-case/in b/test/indent/sh/indent-block-case/in new file mode 100644 index 00000000..b0d854a5 --- /dev/null +++ b/test/indent/sh/indent-block-case/in @@ -0,0 +1,3 @@ +case $foo in + bar) thing1;; + baz) diff --git a/test/indent/sh/indent-block-case/out b/test/indent/sh/indent-block-case/out new file mode 100644 index 00000000..06c64dac --- /dev/null +++ b/test/indent/sh/indent-block-case/out @@ -0,0 +1,5 @@ +case $foo in + bar) thing1;; + baz) + thing1 + thing2 diff --git a/test/indent/sh/indent-block-case/rc b/test/indent/sh/indent-block-case/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/indent-block-case/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh diff --git a/test/indent/sh/indent-compound-command/cmd b/test/indent/sh/indent-compound-command/cmd new file mode 100644 index 00000000..0bc4727f --- /dev/null +++ b/test/indent/sh/indent-compound-command/cmd @@ -0,0 +1 @@ +geithing1 diff --git a/test/indent/sh/indent-compound-command/in b/test/indent/sh/indent-compound-command/in new file mode 100644 index 00000000..957b235e --- /dev/null +++ b/test/indent/sh/indent-compound-command/in @@ -0,0 +1 @@ +foo () { diff --git a/test/indent/sh/indent-compound-command/out b/test/indent/sh/indent-compound-command/out new file mode 100644 index 00000000..43b16506 --- /dev/null +++ b/test/indent/sh/indent-compound-command/out @@ -0,0 +1,2 @@ +foo () { + thing1 diff --git a/test/indent/sh/indent-compound-command/rc b/test/indent/sh/indent-compound-command/rc new file mode 100644 index 00000000..4795bd80 --- /dev/null +++ b/test/indent/sh/indent-compound-command/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/filetype/sh.kak" +set buffer filetype sh