diff src/testdir/test_netbeans.vim @ 9521:820c8861d15c v7.4.2041

commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 15 17:41:56 2016 +0200 patch 7.4.2041 Problem: Netbeans file authentication not tested. Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jul 2016 17:45:05 +0200
parents 9f8f03a44886
children 20e7be5d99ac
line wrap: on
line diff
--- a/src/testdir/test_netbeans.vim
+++ b/src/testdir/test_netbeans.vim
@@ -49,3 +49,28 @@ func Test_nb_basic()
   call ch_log('Test_nb_basic')
   call s:run_server('Nb_basic')
 endfunc
+
+func Nb_file_auth(port)
+  call assert_fails('nbstart =notexist', 'E660:')
+  call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth')
+  call setfperm('Xnbauth', "rw-r--r--")
+  call assert_fails('nbstart =Xnbauth', 'E668:')
+  call setfperm('Xnbauth', "rw-------")
+  exe 'nbstart :localhost:' . a:port . ':bunny'
+  call assert_true(has("netbeans_enabled"))
+
+  call WaitFor('len(readfile("Xnetbeans")) > 2')
+  nbclose
+  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 delete("Xnbauth")
+  call delete("Xnetbeans")
+endfunc
+
+func Test_nb_file_auth()
+  call ch_log('Test_nb_file_auth')
+  call s:run_server('Nb_file_auth')
+endfunc