junegunn / junegunn/vader.vim

Fix Vader's tests for older Vim

Open
#147 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
599
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Vader's own test suite fails when using an older Vim (the one installed on Travis already).

```
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:43:18)
Included patches: 1-52
Extra patches: 8.0.0056
```

Build log: https://travis-ci.org/junegunn/vader.vim/jobs/321548833

```
Vim: Warning: Output is not to a terminal
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:43:18)
Included patches: 1-52
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand -perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu -ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions

Starting Vader: 1 suite(s), 64 case(s)
Starting Vader: /home/travis/build/junegunn/vader.vim/test/vader.vader
( 1/64) [EXECUTE]
> Hello !
( 2/64) [EXECUTE] Assert and AssertEqual command
( 3/64) [EXECUTE] AssertThrows
( 3/64) [EXECUTE] (X) 'function vader#assert#throws[5]..VaderThrows, line 1' should be equal to 'function vader#assert#throws..VaderThrows, line 1'
( 4/64) [EXECUTE] AssertEqual handles funcrefs
( 5/64) [EXECUTE] FIXME: AssertThrows expects an exception to be thrown
( 5/64) [EXECUTE] (X) Exception expected but not raised: call reverse([1, 2, 3])
( 6/64) [EXECUTE] FIXME: Optional message parameter to Assert command
( 6/64) [EXECUTE] (X) 1 is not equal to 2
( 7/64) [EXECUTE] FIXME: Optional message parameter to AssertEqual
( 7/64) [EXECUTE] (X) 1 != 2
( 8/64) [EXECUTE] FIXME: Optional message parameter to AssertNotEqual
( 8/64) [EXECUTE] (X) 1 == 2
( 9/64) [EXECUTE] Save global option values before changing them
(10/64) [ GIVEN] Block content is injected and highlighted as ruby code
(10/64) [ DO] Do block content is keystrokes in normal mode
(10/64) [ EXPECT] Expect block content should match the result of previous Do block
(11/64) [ GIVEN] Block content is injected and highlighted as ruby code
(11/64) [ DO] FIXME: Nothing
(11/64) [ EXPECT] (X) Previous Given block is repeated, thus this should fail
- Expected:
def b
a = 1
end
- Got:
def a
a = 1
end
(12/64) [ GIVEN] Block content is injected and highlighted as ruby code
(12/64) [ DO] Indent and shift given ruby code
(12/64) [ EXPECT] indented and shifted
(13/64) [ GIVEN] Block content is injected and highlighted as ruby code
(13/64) [ DO] FIXME: Execute a non-existent command should raise an error
(13/64) [ DO] (X) Vim:E492: Not an editor command: non-existent-command
> function 20_vader..vader#run..21_run..vader#window#replay, line 2
(14/64) [ GIVEN] Block content is injected and highlighted as ruby code
(14/64) [EXECUTE] Revert changed option values
(15/64) [ GIVEN]
(15/64) [ DO]
(15/64) [ EXPECT]
(16/64) [ GIVEN]
(16/64) [EXECUTE] FIXME: Execute block does not require an Expect block
(16/64) [EXECUTE] (X) 2 should be equal to 1
(17/64) [ GIVEN]
(17/64) [ DO] Do block *not* followed by an Expect block
(18/64) [ GIVEN]
(18/64) [ DO] Do block followed by an Expect block
(18/64) [ EXPECT]
(19/64) [ GIVEN]
(19/64) [EXECUTE] FIXME: Execute block can also be followed by an Expect block
(19/64) [ EXPECT] (X) Comparison is case-sensitive
- Expected:
some string
MORE string
even more string
- Got:
Some string
more string
even more string
(20/64) [ GIVEN]
(20/64) [ DO] ]]
(20/64) [ EXPECT]
(21/64) [ GIVEN]
(21/64) [ DO] [[
(21/64) [ EXPECT]
(22/64) [ GIVEN]
(22/64) [ DO] ][ / []
(22/64) [ EXPECT]
(23/64) [ GIVEN] fixture
(23/64) [ DO] modification
(23/64) [ EXPECT] result
(24/64) [ GIVEN] fixture
(24/64) [ DO] another modification
(24/64) [ EXPECT] invalid result
(25/64) [ GIVEN] fixture
(25/64) [EXECUTE]
(26/64) [ GIVEN] fixture
> Before block increases counter by 1
(26/64) [EXECUTE]
> It should be 1
> After block increases counter by 2
(27/64) [ GIVEN] fixture
> Before block increases counter by 1
(27/64) [EXECUTE]
> It should be 4
> After block increases counter by 2
(28/64) [ GIVEN] fixture
(28/64) [EXECUTE]
> Goodbye!
(29/64) [ GIVEN] fixture
(29/64) [EXECUTE] Initialize vars
(30/64) [ GIVEN] fixture
(30/64) [EXECUTE] Save vars - comma-separated list of optionally-quoted names
(31/64) [ GIVEN] fixture
(31/64) [EXECUTE] Save/Restore vars by value
(32/64) [ GIVEN] fixture
(32/64) [EXECUTE] Set previously undefined vars
(33/64) [ GIVEN] fixture
(33/64) [EXECUTE] Unlet vars
(34/64) [ GIVEN] fixture
(34/64) [EXECUTE] Restore g:abc and g:def - names can be optionally quoted
(35/64) [ GIVEN] fixture
(35/64) [EXECUTE] Check g:abc and g:def
(36/64) [ GIVEN] fixture
(36/64) [EXECUTE] g:xyz and $ENVVAR should not exist
(37/64) [ GIVEN] fixture
(37/64) [EXECUTE] Restore everything
(38/64) [ GIVEN] fixture
(38/64) [EXECUTE] g:undefined should not exist
(39/64) [ GIVEN] fixture
(39/64) [EXECUTE] Restore everthing again
(40/64) [ GIVEN] fixture
(40/64) [EXECUTE] Cleanup
(41/64) [ GIVEN] Some string
(41/64) [EXECUTE] Ruby code
(41/64) [EXECUTE] (X) Vim(ruby):E319: Sorry, the command is not available in this version: ruby << __VADER__LANG__IF__
> /tmp/vxvCRJa/33, line 1
(41/64) [ EXPECT] (X)
- Expected:
Hello
Hello
vader.vader
- Got:
Hello
(42/64) [ GIVEN] Some string
(42/64) [EXECUTE] Python code
(42/64) [ EXPECT]
(43/64) [ GIVEN] markdown without indentation
(43/64) [EXECUTE]
> Hello !
(44/64) [ GIVEN] markdown without indentation
(44/64) [ DO]
(44/64) [ EXPECT] without indentation
(45/64) [ GIVEN] markdown without indentation
(45/64) [EXECUTE]
(45/64) [ EXPECT]
(46/64) [ GIVEN] C file
(46/64) [EXECUTE] SyntaxAt()
(47/64) [ GIVEN] C file
(47/64) [EXECUTE] SyntaxAt(col)
(48/64) [ GIVEN] C file
(48/64) [EXECUTE] SyntaxAt(lnum, col)
(49/64) [ GIVEN] C file
(49/64) [EXECUTE] SyntaxOf(pattern)
(50/64) [ GIVEN] C file
(50/64) [EXECUTE] SyntaxOf(pattern, count)
(51/64) [ GIVEN] C file
(51/64) [EXECUTE] SyntaxOf does not move cursor
(52/64) [ GIVEN]
(52/64) [ DO] Macro that ends with
(52/64) [ EXPECT]
(53/64) [ GIVEN]
(53/64) [EXECUTE] Assertions
(54/64) [ GIVEN]
(54/64) [EXECUTE] Create temp file
(55/64) [ GIVEN] File path
(55/64) [ DO] Go to file
(55/64) [ EXPECT] Should see the content of the current buffer instead of workbench buffer
(56/64) [ GIVEN] File path
(56/64) [ DO] Vader should switch back to the workbench buffer
(56/64) [ EXPECT] Modified workbench buffer
(57/64) [ GIVEN] File path
(57/64) [EXECUTE] The buffer shouldn't have been modified
(58/64) [EXECUTE] Check filetype
(59/64) [EXECUTE] Check filetype
(60/64) [EXECUTE] Check filetype again
(61/64) [EXECUTE] Check filetype - should be reset
(62/64) [ GIVEN] Vader file with interleaved comments
(62/64) [EXECUTE] Check syntax
(63/64) [ GIVEN] Vader file with interleaved comments
(63/64) [EXECUTE] buftype in new tabpage
(64/64) [ GIVEN] Vader file with interleaved comments
(64/64) [EXECUTE]
> Good-bye !
Success/Total: 54/64 (8 pending)
Success/Total: 54/64 (8 pending, assertions: 66/72)
Elapsed time: 0.719538 sec.
```
It would be nice if tests would pass there (potentially skipping some of them).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.