heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

Vader test fixes for Neovim #91

Closed brentyi closed 4 years ago

brentyi commented 4 years ago

Followup to #89, intended to resolve issues with #90. Seems there were a lot more edge cases than I expected...

Test outputs:

As an aside, I wasn't able get all of the tests to pass in Vim 8.0.

heavenshell commented 4 years ago

@brentyi Thank you for helping me!

Looks fine in my env, so I'll merge this.

$ VIM_EXE=/tmp/build/bin/vim ./run.sh
Vader note: cannot print to stderr reliably/directly.  Please consider using Vim's -es/-Es option (mode=n).
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 26 2019 00:33:21)
macOS version
Included patches: 1-43
Compiled by s_ohyanagi@rapunzel.local
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_old_static
+arabic            +file_in_path      +mouse_urxvt       -tag_any_white
+autocmd           +find_in_path      +mouse_xterm       -tcl
+autochdir         +float             +multi_byte        +termguicolors
-autoservername    +folding           +multi_lang        +terminal
-balloon_eval      -footer            -mzscheme          +terminfo
+balloon_eval_term +fork()            +netbeans_intg     +termresponse
-browse            +gettext           +num64             +textobjects
++builtin_terms    -hangul_input      +packages          +textprop
+byte_offset       +iconv             +path_extra        +timers
+channel           +insert_expand     +perl/dyn          +title
+cindent           +job               +persistent_undo   -toolbar
-clientserver      +jumplist          +popupwin          +user_commands
+clipboard         +keymap            +postscript        +vartabs
+cmdline_compl     +lambda            +printer           +vertsplit
+cmdline_hist      +langmap           +profile           +virtualedit
+cmdline_info      +libcall           +python/dyn        +visual
+comments          +linebreak         +python3/dyn       +visualextra
+conceal           +lispindent        +quickfix          +viminfo
+cryptv            +listcmds          +reltime           +vreplace
+cscope            +localmap          +rightleft         +wildignore
+cursorbind        +lua               +ruby              +wildmenu
+cursorshape       +menu              +scrollbind        +windows
+dialog_con        +mksession         +signs             +writebackup
+diff              +modify_fname      +smartindent       -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/tmp/vim/build/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -I/opt/local/include -DMACOS_X -DMACOS_X_DARWIN  -mmacosx-version-min=10.14 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang   -L. -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fstack-protector-strong -L/opt/local/lib -L/opt/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -pagezero_size 10000 -image_base 100000000 -L/opt/local/lib -lluajit-5.1 -fstack-protector -L/opt/local/lib  -L/tmp/lang/perl5/plenv/versions/5.20.3/lib/5.20.3/darwin-2level/CORE -lperl -lm -lutil -lc    -lruby.2.6  -L/opt/local/lib

Starting Vader: 5 suite(s), 30 case(s)
  Starting Vader: /tmp/vim-pydocstring/tests/format.vader
    (1/2) [EXECUTE] Setup template dir
    (2/2) [  GIVEN] Format all
    (2/2) [EXECUTE]
    (2/2) [ EXPECT]
  Success/Total: 2/2
  Starting Vader: /tmp/vim-pydocstring/tests/google.vader
    (1/4) [EXECUTE] Setup template dir
    (2/4) [  GIVEN] def foo
    (2/4) [EXECUTE]
    (2/4) [ EXPECT]
    (3/4) [  GIVEN] def foo with 1 param
    (3/4) [EXECUTE]
    (3/4) [ EXPECT]
    (4/4) [  GIVEN] def foo with 2 params and type hints
    (4/4) [EXECUTE]
    (4/4) [ EXPECT]
  Success/Total: 4/4
  Starting Vader: /tmp/vim-pydocstring/tests/numpy.vader
    (1/4) [EXECUTE] Setup template dir
    (2/4) [  GIVEN] def foo
    (2/4) [EXECUTE]
    (2/4) [ EXPECT]
    (3/4) [  GIVEN] def foo with 1 param
    (3/4) [EXECUTE]
    (3/4) [ EXPECT]
    (4/4) [  GIVEN] def foo with 2 params and type hints
    (4/4) [EXECUTE]
    (4/4) [ EXPECT]
  Success/Total: 4/4
  Starting Vader: /tmp/vim-pydocstring/tests/sphinx.vader
    ( 1/16) [EXECUTE] Setup template dir
    ( 2/16) [  GIVEN] def foo
    ( 2/16) [EXECUTE]
    ( 2/16) [ EXPECT]
    ( 3/16) [  GIVEN] def foo with 1 param
    ( 3/16) [EXECUTE]
    ( 3/16) [ EXPECT]
    ( 4/16) [  GIVEN] def foo with 2 params
    ( 4/16) [EXECUTE]
    ( 4/16) [ EXPECT]
    ( 5/16) [  GIVEN] def foo with 2 params and a comment block
    ( 5/16) [EXECUTE]
    ( 5/16) [ EXPECT]
    ( 6/16) [  GIVEN] def foo with variadic params
    ( 6/16) [EXECUTE]
    ( 6/16) [ EXPECT]
    ( 7/16) [  GIVEN] class Foo no extends
    ( 7/16) [EXECUTE]
    ( 7/16) [ EXPECT]
    ( 8/16) [  GIVEN] class Foo extends multiple classes
    ( 8/16) [EXECUTE]
    ( 8/16) [ EXPECT]
    ( 9/16) [  GIVEN] class Foo
    ( 9/16) [EXECUTE]
    ( 9/16) [ EXPECT]
    (10/16) [  GIVEN] class Foo
    (10/16) [     DO] Put cursor to def foo(self)
    (10/16) [   THEN] Execute Pydocstring on def foo(self)
    (10/16) [ EXPECT]
    (11/16) [  GIVEN] class Foo
    (11/16) [     DO] Put cursor to def arg1(self, arg1)
    (11/16) [   THEN] Execute Pydocstring on def arg1(self, arg1)
    (11/16) [ EXPECT]
    (12/16) [  GIVEN] async def foo
    (12/16) [EXECUTE]
    (12/16) [ EXPECT]
    (13/16) [  GIVEN] type hint arg
    (13/16) [EXECUTE]
    (13/16) [ EXPECT]
    (14/16) [  GIVEN] type hint args
    (14/16) [EXECUTE]
    (14/16) [ EXPECT]
    (15/16) [  GIVEN] return type hint
    (15/16) [EXECUTE]
    (15/16) [ EXPECT]
    (16/16) [  GIVEN] type hint and return type hint
    (16/16) [EXECUTE]
    (16/16) [ EXPECT]
  Success/Total: 16/16
  Starting Vader: /tmp/vim-pydocstring/tests/template.vader
    (1/4) [EXECUTE] Setup template dir
    (2/4) [  GIVEN] def foo
    (2/4) [EXECUTE]
    (2/4) [ EXPECT]
    (3/4) [  GIVEN] def foo with 1 param
    (3/4) [EXECUTE]
    (3/4) [ EXPECT]
    (4/4) [  GIVEN] def foo with 2 params and type hints
    (4/4) [EXECUTE]
    (4/4) [ EXPECT]
  Success/Total: 4/4
Success/Total: 30/30 (assertions: 0/0)
Elapsed time: 15.50 sec.