greatly expanded tests · python-canux/python-mode@0b3bbad · GitHub
Skip to content

Commit 0b3bbad

Browse files
committed
greatly expanded tests
1 parent 8d7405e commit 0b3bbad

12 files changed

Lines changed: 699 additions & 12 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions

ftplugin/python/pymode.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ if g:pymode_debug
228228
" Get a system independent temporary filename. The 'marker' variable is
229229
" used to get rid of a null character getting inserted at position.
230230
" substitute() was not able to remove it.
231+
" TODO: see https://superuser.com/questions/935574/get-rid-of-null-character-in-vim-variable
231232
let g:pymode_debug_tempfile=matchstr(
232233
\ execute(
233234
\ g:pymode_python

readme.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ help packages` in vim for details.
9898
cd ~/.vim
9999
mkdir -p bundle && cd bundle
100100
git clone https://github.com/python-mode/python-mode.git
101-
cd python-mode
102-
git submodule update --init --recursive
103101

104102
Enable [pathogen](https://github.com/tpope/vim-pathogen) in your `~/.vimrc`:
105103

@@ -116,7 +114,6 @@ Enable [pathogen](https://github.com/tpope/vim-pathogen) in your `~/.vimrc`:
116114

117115
% git clone https://github.com/python-mode/python-mode.git
118116
% cd python-mode
119-
% git submodule update --init --recursive
120117
% cp -R * ~/.vim
121118

122119
Then rebuild **helptags** in vim:

tests/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
set -e
55
which vim 1>/dev/null 2>/dev/null
66

7+
cd $(dirname $0)
8+
79
# Source common variables.
810
source ./test_helpers_bash/test_variables.sh
911

tests/test_bash/test_folding.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22

33
# Source file.
44
set +e
5-
RETURN_CODE=$(vim -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding1.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1)
5+
source ./test_helpers_bash/test_prepare_between_tests.sh
6+
vim -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding1.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
67
R1=$?
7-
bash ./test_helpers_bash/test_prepare_between_tests.sh
8-
RETURN_CODE=$(vim -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding2.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1)
8+
source ./test_helpers_bash/test_prepare_between_tests.sh
9+
vim -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding2.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
910
R2=$?
11+
source ./test_helpers_bash/test_prepare_between_tests.sh
12+
vim -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding3.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
13+
R3=$?
1014
set -e
15+
1116
if [[ "$R1" -ne 0 ]]
1217
then
1318
exit 1
1419
elif [[ "$R2" -ne 0 ]]
1520
then
1621
exit 2
22+
elif [[ "$R3" -ne 0 ]]
23+
then
24+
exit 3
1725
fi
1826

19-
exit 0
20-
2127
# vim: set fileformat=unix filetype=sh wrap tw=0 :
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
#! /bin/bash
22

33
# Create minimal vimrc.
4+
echo -e "syntax on\nfiletype plugin indent on\nset nocompatible" >> $VIM_TEST_VIMRC
45
echo "call has('python3')" >> $VIM_TEST_VIMRC
5-
echo "set noswapfile" >> $VIM_TEST_VIMRC
6-
echo "set shell=bash" >> $VIM_TEST_VIMRC
6+
echo "set paste" >> $VIM_TEST_VIMRC
7+
echo "set shortmess=at" >> $VIM_TEST_VIMRC
8+
echo "set cmdheight=10" >> $VIM_TEST_VIMRC
79
echo "set ft=python" >> $VIM_TEST_VIMRC
8-
echo -e "syntax on\nfiletype plugin indent on\nset nocompatible" >> $VIM_TEST_VIMRC
10+
echo "set shell=bash" >> $VIM_TEST_VIMRC
11+
echo "set noswapfile" >> $VIM_TEST_VIMRC
12+
echo "set backupdir=" >> $VIM_TEST_VIMRC
13+
echo "set undodir=" >> $VIM_TEST_VIMRC
14+
echo "set viewdir=" >> $VIM_TEST_VIMRC
15+
echo "set directory=" >> $VIM_TEST_VIMRC
16+
echo -e "set runtimepath=" >> $VIM_TEST_VIMRC
917
echo -e "set runtimepath+=$(dirname $PWD)\n" >> $VIM_TEST_VIMRC
18+
# echo -e "redir! >> $VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC
1019
echo -e "set verbosefile=$VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC
20+
echo -e "let g:pymode_debug = 1" >> $VIM_TEST_VIMRC
21+
22+
echo "set nomore" >> $VIM_TEST_VIMRC
23+
1124

1225
# vim: set fileformat=unix filetype=sh wrap tw=0 :

tests/test_helpers_bash/test_prepare_between_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Prepare tests.
44
set +e
5-
rm $VIM_DISPOSABLE_PYFILE 2&>/dev/null
5+
rm $VIM_DISPOSABLE_PYFILE
6+
export VIM_DISPOSABLE_PYFILE=`mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py`
67
set -e
78
touch $VIM_DISPOSABLE_PYFILE
89

tests/test_helpers_bash/test_prepare_once.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Prepare tests.
44
set +e
55
rm $VIM_OUTPUT_FILE $VIM_TEST_VIMRC $VIM_TEST_PYMODECOMMANDS $VIM_DISPOSABLE_PYFILE 2&>/dev/null
6+
rm /tmp/*pymode* 2&>/dev/null
67
set -e
78

89
# vim: set fileformat=unix filetype=sh wrap tw=0 :
Lines changed: 98 additions & 0 deletions

tests/test_helpers_vimscript/moving_around.vim

Whitespace-only changes.

0 commit comments

Comments
 (0)