Mercurial > vim
comparison src/testdir/test_netbeans.vim @ 31665:8492bbc9f533 v9.0.1165
patch 9.0.1165: tests using IPv6 sometimes fail
Commit: https://github.com/vim/vim/commit/765d82a657c5e42d5d7c88ae410e53f398c34c43
Author: James McCoy <jamessan@jamessan.com>
Date: Mon Jan 9 16:25:59 2023 +0000
patch 9.0.1165: tests using IPv6 sometimes fail
Problem: Tests using IPv6 sometimes fail.
Solution: Use getaddrinfo() and use try/catch. (James McCoy,
closes #11783)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 Jan 2023 17:30:07 +0100 |
parents | 72245f9c9405 |
children |
comparison
equal
deleted
inserted
replaced
31664:6a7cadad56e7 | 31665:8492bbc9f533 |
---|---|
885 func ReadXnetbeans() | 885 func ReadXnetbeans() |
886 let l = readfile("Xnetbeans") | 886 let l = readfile("Xnetbeans") |
887 return filter(l, 'v:val !~ "^0:geometry="') | 887 return filter(l, 'v:val !~ "^0:geometry="') |
888 endfunc | 888 endfunc |
889 | 889 |
890 " Establish the connection with the netbeans server | 890 try |
891 exe 'nbstart :localhost:' .. g:port .. ':star' | 891 " Establish the connection with the netbeans server |
892 call assert_true(has("netbeans_enabled")) | 892 exe 'nbstart :localhost:' .. g:port .. ':star' |
893 call WaitFor('len(ReadXnetbeans()) >= 3') | 893 call assert_true(has("netbeans_enabled")) |
894 let l = ReadXnetbeans() | 894 call WaitFor('len(ReadXnetbeans()) >= 3') |
895 call assert_equal(['AUTH star', | 895 let l = ReadXnetbeans() |
896 \ '0:version=0 "2.5"', | 896 call assert_equal(['AUTH star', |
897 \ '0:startupDone=0'], l[-3:]) | 897 \ '0:version=0 "2.5"', |
898 | 898 \ '0:startupDone=0'], l[-3:]) |
899 " Open the command buffer to communicate with the server | 899 |
900 split Xcmdbuf | 900 " Open the command buffer to communicate with the server |
901 call WaitFor('len(ReadXnetbeans()) >= 6') | 901 split Xcmdbuf |
902 let l = ReadXnetbeans() | 902 call WaitFor('len(ReadXnetbeans()) >= 6') |
903 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F', | 903 let l = ReadXnetbeans() |
904 \ substitute(l[-3], '".*/', '"', '')) | 904 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F', |
905 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"', | 905 \ substitute(l[-3], '".*/', '"', '')) |
906 \ substitute(l[-2], '".*/', '"', '')) | 906 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"', |
907 call assert_equal('1:startDocumentListen!16', l[-1]) | 907 \ substitute(l[-2], '".*/', '"', '')) |
908 sleep 1m | 908 call assert_equal('1:startDocumentListen!16', l[-1]) |
909 | 909 sleep 1m |
910 quit! | 910 |
911 quit! | 911 quit! |
912 quit! | |
913 finally | |
914 qall! | |
915 endtry | |
912 END | 916 END |
913 if RunVim(['let g:port = ' .. a:port], after, '') | 917 if RunVim(['let g:port = ' .. a:port], after, '') |
914 call WaitFor('len(ReadXnetbeans()) >= 9') | 918 call WaitFor('len(ReadXnetbeans()) >= 9') |
915 let l = ReadXnetbeans() | 919 let l = ReadXnetbeans() |
916 call assert_equal('1:unmodified=16', l[-3]) | 920 call assert_equal('1:unmodified=16', l[-3]) |