view src/testdir/test_netbeans.vim @ 9517:9f8f03a44886 v7.4.2039

commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 15 17:09:11 2016 +0200 patch 7.4.2039 Problem: The Netbeans integration is not tested. Solution: Add a first Netbeans test.
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jul 2016 17:15:05 +0200
parents
children 820c8861d15c
line wrap: on
line source

" Test the netbeans interface.

if !has('netbeans_intg')
  finish
endif

source shared.vim

let s:python = PythonProg()
if s:python == ''
  " Can't run this test.
  finish
endif

" Run "testfunc" after sarting the server and stop the server afterwards.
func s:run_server(testfunc, ...)
  call RunServer('test_netbeans.py', a:testfunc, a:000)
endfunc

func Nb_basic(port)
  call delete("Xnetbeans")
  exe 'nbstart :localhost:' . a:port . ':bunny'
  call assert_true(has("netbeans_enabled"))

  call WaitFor('len(readfile("Xnetbeans")) > 2')
  split +$ Makefile

  " Opening Makefile will result in a setDot command
  call WaitFor('len(readfile("Xnetbeans")) > 4')
  let pos = getcurpos()
  call assert_equal(2, pos[1])
  call assert_equal(20, pos[2])
  close
  nbclose

  call WaitFor('len(readfile("Xnetbeans")) > 6')
  let lines = readfile("Xnetbeans")
  call assert_equal('AUTH bunny', lines[0])
  call assert_equal('0:version=0 "2.5"', lines[1])
  call assert_equal('0:startupDone=0', lines[2])
  call assert_equal('0:fileOpened=0 "Makefile" T F', substitute(lines[3], '".*/', '"', ''))

  call assert_equal('0:disconnect=1', lines[6])

  call delete("Xnetbeans")
endfunc

func Test_nb_basic()
  call ch_log('Test_nb_basic')
  call s:run_server('Nb_basic')
endfunc