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.
|
# 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
|
rm -f *.out
|
||||||
|
|
||||||
for testcase in test*.vim; do
|
for testcase in test*.vim; do
|
||||||
vim -N -u NONE -S $testcase -c 'quit!' # testFoo.vim
|
vim -N -u NONE -S $testcase -c 'quit!'
|
||||||
testname=${testcase%.*} # testFoo
|
canonicalise_test_name $testcase
|
||||||
name=${testname:4} # Foo
|
|
||||||
name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" # foo
|
|
||||||
expected=$name.ok
|
expected=$name.ok
|
||||||
actual=$name.out
|
actual=$name.out
|
||||||
diff $expected $actual && echo "$name ok" || echo "$name failed"
|
diff $expected $actual && echo "$name ok" || echo "$name failed"
|
||||||
|
|||||||
Reference in New Issue
Block a user