mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 03:53:47 -05:00
Extract name manipulation.
This commit is contained in:
14
test/test.sh
14
test/test.sh
@@ -2,13 +2,19 @@
|
||||
|
||||
# TODO: exit with non-zero status code when tests fail.
|
||||
|
||||
canonicalise_test_name() {
|
||||
local testname=$1 # testFoo.vim
|
||||
name=${testname%.*} # testFoo
|
||||
name=${name:4} # Foo
|
||||
name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" # foo
|
||||
}
|
||||
|
||||
|
||||
rm -f *.out
|
||||
|
||||
for testcase in test*.vim; do
|
||||
vim -N -u NONE -S $testcase -c 'quit!' # testFoo.vim
|
||||
testname=${testcase%.*} # testFoo
|
||||
name=${testname:4} # Foo
|
||||
name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" # foo
|
||||
vim -N -u NONE -S $testcase -c 'quit!'
|
||||
canonicalise_test_name $testcase
|
||||
expected=$name.ok
|
||||
actual=$name.out
|
||||
diff $expected $actual && echo "$name ok" || echo "$name failed"
|
||||
|
||||
Reference in New Issue
Block a user