Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom vimrc in tests #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tags
result.hs
2 changes: 2 additions & 0 deletions tests/indent/base.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set ts=2 sts=2 sw=2 expandtab
source ../../../indent/haskell.vim
12 changes: 10 additions & 2 deletions tests/indent/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/bin/sh

COUNT_FAIL=0
COUNT_PASS=0

for i in test???; do
cd $i
nvim --headless -s test.vim test.hs 2> /dev/null
nvim --headless -u ../base.rc -s test.vim test.hs 2> /dev/null
diff expected.hs result.hs
if [ $? -eq 0 ]; then
echo "$(basename $PWD) succeded"
COUNT_PASS=$((COUNT_PASS+1))
echo "$(basename $PWD) succeeded"
rm result.hs
else
COUNT_FAIL=$((COUNT_FAIL+1))
echo "$(basename $PWD) failed"
fi
cd ..
done

echo "===="
echo "PASSED: $COUNT_PASS\tFAILED: $COUNT_FAIL"
5 changes: 5 additions & 0 deletions tests/indent/test020/expected.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if True
then do
print 1
else do
print 2
1 change: 1 addition & 0 deletions tests/indent/test020/test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
if True
3 changes: 3 additions & 0 deletions tests/indent/test020/test.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GAthen doprint 1else doprint 2
:saveas! result.hs
:q!
Expand Down