annotate src/testdir/test_netbeans.vim @ 22892:d3afe009826a v8.2.1993

patch 8.2.1993: occasional failure of the netbeans test Commit: https://github.com/vim/vim/commit/50dc3ecc642ee88348cb353cf85d08eac26c75dd Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 16 18:39:43 2020 +0100 patch 8.2.1993: occasional failure of the netbeans test Problem: Occasional failure of the netbeans test. Solution: Add "silent!". (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/7304)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Nov 2020 18:45:04 +0100
parents 70eb58639009
children b545334ae654
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test the netbeans interface.
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
3 source check.vim
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
4 CheckFeature netbeans_intg
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 source shared.vim
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 let s:python = PythonProg()
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 if s:python == ''
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
10 throw 'Skipped: python program missing'
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endif
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
13 " Run "testfunc" after starting the server and stop the server afterwards.
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 func s:run_server(testfunc, ...)
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 call RunServer('test_netbeans.py', a:testfunc, a:000)
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfunc
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
18 " Wait for an exception (error) to be thrown. This is used to check whether a
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
19 " message from the netbeans server causes an error. It takes some time for Vim
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
20 " to process a netbeans message. So a sleep is used below to account for this.
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
21 func WaitForError(errcode)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
22 let save_exception = ''
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
23 for i in range(200)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
24 try
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
25 sleep 5m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
26 catch
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
27 let save_exception = v:exception
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
28 break
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
29 endtry
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
30 endfor
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
31 call assert_match(a:errcode, save_exception)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
32 endfunc
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
33
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
34 " Read the "Xnetbeans" file and filter out geometry messages.
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
35 func ReadXnetbeans()
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
36 let l = readfile("Xnetbeans")
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
37 " Xnetbeans may include '0:geometry=' messages in the GUI Vim if the window
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
38 " position, size, or z order are changed. Remove these messages because
22892
d3afe009826a patch 8.2.1993: occasional failure of the netbeans test
Bram Moolenaar <Bram@vim.org>
parents: 22830
diff changeset
39 " these messages will break the assert for the output.
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
40 return filter(l, 'v:val !~ "^0:geometry="')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
41 endfunc
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
42
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 func Nb_basic(port)
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 call delete("Xnetbeans")
12742
af961e38e508 patch 8.0.1249: no error when WaitFor() gets an invalid wrong expression
Christian Brabandt <cb@256bit.org>
parents: 12734
diff changeset
45 call writefile([], "Xnetbeans")
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
46
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
47 " Last line number in the Xnetbeans file. Used to verify the result of the
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
48 " communication with the netbeans server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
49 let g:last = 0
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
50
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
51 " Establish the connection with the netbeans server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
52 exe 'nbstart :localhost:' .. a:port .. ':bunny'
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_true(has("netbeans_enabled"))
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
54 call WaitFor('len(ReadXnetbeans()) > (g:last + 2)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
55 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
56 call assert_equal(['AUTH bunny',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
57 \ '0:version=0 "2.5"',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
58 \ '0:startupDone=0'], l[-3:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
59 let g:last += 3
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
61 " Trying to connect again to netbeans server should fail
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
62 call assert_fails("exe 'nbstart :localhost:' . a:port . ':bunny'", 'E511:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
63
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
64 " Open the command buffer to communicate with the server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
65 split Xcmdbuf
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
66 let cmdbufnr = bufnr()
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
67 call WaitFor('len(ReadXnetbeans()) > (g:last + 2)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
68 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
69 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
70 \ substitute(l[-3], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
71 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
72 \ substitute(l[-2], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
73 call assert_equal('1:startDocumentListen!16', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
74 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
75
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
76 " Keep the command buffer loaded for communication
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
77 hide
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
78
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
79 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
80
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
81 " getCursor test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
82 call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
83 split Xfile1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
84 call cursor(3, 4)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
85 sleep 10m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
86 call appendbufline(cmdbufnr, '$', 'getCursor_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
87 call WaitFor('len(ReadXnetbeans()) >= (g:last + 5)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
88 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
89 call assert_equal(['send: 0:getCursor/30', '30 -1 3 3 19'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
90 let g:last += 5
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
91
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
92 " Test for E627
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
93 call appendbufline(cmdbufnr, '$', 'E627_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
94 call WaitForError('E627:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
95 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
96 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
97 call assert_equal('send: 0 setReadOnly!31', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
98 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
99
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
100 " Test for E628
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
101 call appendbufline(cmdbufnr, '$', 'E628_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
102 call WaitForError('E628:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
103 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
104 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
105 call assert_equal('send: 0:setReadOnly 32', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
106 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
107
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
108 " Test for E632
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
109 call appendbufline(cmdbufnr, '$', 'E632_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
110 call WaitForError('E632:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
111 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
112 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
113 call assert_equal(['send: 0:getLength/33', '33 0'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
114 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
115
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
116 " Test for E633
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
117 call appendbufline(cmdbufnr, '$', 'E633_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
118 call WaitForError('E633:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
119 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
120 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
121 call assert_equal(['send: 0:getText/34', '34 '], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
122 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
123
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
124 " Test for E634
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
125 call appendbufline(cmdbufnr, '$', 'E634_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
126 call WaitForError('E634:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
127 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
128 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
129 call assert_equal(['send: 0:remove/35 1 1', '35'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
130 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
131
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
132 " Test for E635
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
133 call appendbufline(cmdbufnr, '$', 'E635_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
134 call WaitForError('E635:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
135 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
136 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
137 call assert_equal(['send: 0:insert/36 0 "line1\n"', '36'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
138 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
139
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
140 " Test for E636
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
141 call appendbufline(cmdbufnr, '$', 'E636_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
142 call WaitForError('E636:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
143 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
144 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
145 call assert_equal('send: 0:create!37', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
146 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
147
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
148 " Test for E637
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
149 call appendbufline(cmdbufnr, '$', 'E637_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
150 call WaitForError('E637:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
151 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
152 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
153 call assert_equal('send: 0:startDocumentListen!38', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
154 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
155
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
156 " Test for E638
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
157 call appendbufline(cmdbufnr, '$', 'E638_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
158 call WaitForError('E638:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
159 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
160 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
161 call assert_equal('send: 0:stopDocumentListen!39', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
162 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
163
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
164 " Test for E639
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
165 call appendbufline(cmdbufnr, '$', 'E639_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
166 call WaitForError('E639:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
167 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
168 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
169 call assert_equal('send: 0:setTitle!40 "Title"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
170 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
171
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
172 " Test for E640
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
173 call appendbufline(cmdbufnr, '$', 'E640_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
174 call WaitForError('E640:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
175 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
176 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
177 call assert_equal('send: 0:initDone!41', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
178 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
179
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
180 " Test for E641
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
181 call appendbufline(cmdbufnr, '$', 'E641_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
182 call WaitForError('E641:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
183 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
184 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
185 call assert_equal('send: 0:putBufferNumber!42 "XSomeBuf"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
186 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
187
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
188 " Test for E642
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
189 call appendbufline(cmdbufnr, '$', 'E642_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
190 call WaitForError('E642:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
191 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
192 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
193 call assert_equal('send: 9:putBufferNumber!43 "XInvalidBuf"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
194 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
195
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
196 " Test for E643
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
197 call appendbufline(cmdbufnr, '$', 'E643_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
198 call WaitForError('E643:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
199 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
200 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
201 call assert_equal('send: 0:setFullName!44 "XSomeBuf"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
202 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
203
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
204 enew!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
205
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
206 " Test for E644
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
207 call appendbufline(cmdbufnr, '$', 'E644_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
208 call WaitForError('E644:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
209 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
210 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
211 call assert_equal('send: 0:editFile!45 "Xfile3"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
212 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
213
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
214 " Test for E645 (shown only when verbose > 0)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
215 call appendbufline(cmdbufnr, '$', 'E645_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
216 set verbose=1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
217 call WaitForError('E645:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
218 set verbose&
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
219 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
220 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
221 call assert_equal('send: 0:setVisible!46 T', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
222 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
223
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
224 " Test for E646 (shown only when verbose > 0)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
225 call appendbufline(cmdbufnr, '$', 'E646_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
226 set verbose=1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
227 call WaitForError('E646:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
228 set verbose&
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
229 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
230 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
231 call assert_equal('send: 0:setModified!47 T', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
232 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
233
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
234 " Test for E647
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
235 call appendbufline(cmdbufnr, '$', 'E647_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
236 call WaitForError('E647:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
237 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
238 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
239 call assert_equal('send: 0:setDot!48 1/1', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
240 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
241
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
242 " Test for E648
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
243 call appendbufline(cmdbufnr, '$', 'E648_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
244 call WaitForError('E648:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
245 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
246 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
247 call assert_equal('send: 0:close!49', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
248 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
249
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
250 " Test for E650
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
251 call appendbufline(cmdbufnr, '$', 'E650_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
252 call WaitForError('E650:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
253 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
254 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
255 call assert_equal('send: 0:defineAnnoType!50 1 "abc" "a" "a" 1 1', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
256 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
257
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
258 " Test for E651
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
259 call appendbufline(cmdbufnr, '$', 'E651_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
260 call WaitForError('E651:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
261 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
262 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
263 call assert_equal('send: 0:addAnno!51 1 1 1 1', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
264 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
265
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
266 " Test for E652
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
267 call appendbufline(cmdbufnr, '$', 'E652_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
268 call WaitForError('E652:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
269 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
270 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
271 call assert_equal(['send: 0:getAnno/52 8', '52 0'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
272 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
273
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
274 " editFile test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
275 call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
276 call appendbufline(cmdbufnr, '$', 'editFile_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
277 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
278 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
279 call assert_equal('send: 2:editFile!53 "Xfile3"', l[-2])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
280 call assert_match('0:fileOpened=0 ".*/Xfile3" T F', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
281 call assert_equal('Xfile3', bufname())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
282 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
283
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
284 " getLength test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
285 call appendbufline(cmdbufnr, '$', 'getLength_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
286 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
287 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
288 call assert_equal(['send: 2:getLength/54', '54 27'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
289 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
290
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
291 " getModified test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
292 call appendbufline(cmdbufnr, '$', 'getModified_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
293 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
294 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
295 call assert_equal(['send: 2:getModified/55', '55 0'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
296 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
297
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
298 " getText test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
299 call appendbufline(cmdbufnr, '$', 'getText_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
300 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
301 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
302 call assert_equal(['send: 2:getText/56',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
303 \ '56 "foo bar1\nfoo bar2\nfoo bar3\n"'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
304 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
305
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
306 " setDot test with lnum/col
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
307 call cursor(1, 1)
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
308 call appendbufline(cmdbufnr, '$', 'setDot_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
309 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
310 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
311 call assert_equal('send: 2:setDot!57 3/6', l[-1])
22792
670c69ac1bfb patch 8.2.1944: Netbeans test is flaky
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
312 sleep 10m
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
313 call assert_equal([0, 3, 7, 0], getpos('.'))
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
314 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
315
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
316 " setDot test with an offset
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
317 call cursor(1, 1)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
318 call appendbufline(cmdbufnr, '$', 'setDot2_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
319 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
320 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
321 call assert_equal('send: 2:setDot!57 9', l[-1])
22792
670c69ac1bfb patch 8.2.1944: Netbeans test is flaky
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
322 sleep 10m
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
323 call assert_equal([0, 2, 1, 0], getpos('.'))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
324 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
325
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
326 " startDocumentListen test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
327 call appendbufline(cmdbufnr, '$', 'startDocumentListen_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
328 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
329 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
330 call assert_equal('send: 2:startDocumentListen!58', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
331 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
332
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
333 " make some changes to the buffer and check whether the netbeans server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
334 " received the notifications
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
335 call append(2, 'blue sky')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
336 1d
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
337 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
338 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
339 call assert_match('2:insert=\d\+ 18 "blue sky"', l[-3])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
340 call assert_match('2:insert=\d\+ 26 "\\n"', l[-2])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
341 call assert_match('2:remove=\d\+ 0 9', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
342 let g:last += 3
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
343
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
344 " Change case using the ~ command with 'whichwrap' containing '~'
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
345 set whichwrap+=~
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
346 normal 2G$~
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
347 set whichwrap&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
348 call WaitFor('len(ReadXnetbeans()) >= (g:last + 2)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
349 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
350 call assert_match('2:remove=\d\+ 16 1', l[-4])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
351 call assert_match('2:insert=\d\+ 16 "Y"', l[-3])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
352 call assert_match('2:remove=\d\+ 18 0', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
353 call assert_match('2:insert=\d\+ 18 ""', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
354 let g:last += 4
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
355
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
356 " Test for replacing spaces with a tab character using 'softtabstop' and
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
357 " 'noexpandtab'
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
358 setlocal softtabstop=4
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
359 setlocal noexpandtab
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
360 exe "normal I\<Tab>\<Tab>"
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
361 setlocal expandtab&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
362 setlocal softtabstop&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
363 call WaitFor('len(ReadXnetbeans()) >= (g:last + 18)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
364 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
365 call assert_match('2:insert=\d\+ 18 " foo bar3"', l[-3])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
366 call assert_match('2:remove=\d\+ 26 8', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
367 call assert_match('2:insert=\d\+ 26 "\t"', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
368 let g:last += 18
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
369
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
370 " stopDocumentListen test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
371 call appendbufline(cmdbufnr, '$', 'stopDocumentListen_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
372 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
373 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
374 call assert_equal('send: 2:stopDocumentListen!59', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
375 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
376
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
377 " Wait for vim to process the previous netbeans message
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
378 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
379
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
380 " modify the buffer and make sure that the netbeans server is not notified
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
381 call append(2, 'clear sky')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
382 1d
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
383
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
384 " defineAnnoType test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
385 call appendbufline(cmdbufnr, '$', 'define_anno_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
386 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
387 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
388 call assert_equal('send: 2:defineAnnoType!60 1 "s1" "x" "=>" blue none', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
389 sleep 1m
20390
8bbb8f0b6f9c patch 8.2.0750: netbeans test is a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 20087
diff changeset
390 call assert_equal({'name': '1', 'texthl': 'NB_s1', 'text': '=>'},
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
391 \ sign_getdefined()->get(0, {}))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
392 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
393
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
394 " defineAnnoType with a long color name
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
395 call appendbufline(cmdbufnr, '$', 'E532_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
396 call WaitForError('E532:')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
397 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
398 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
399 call assert_equal('send: 2:defineAnnoType!61 1 "s1" "x" "=>" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa none', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
400 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
401
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
402 " addAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
403 call appendbufline(cmdbufnr, '$', 'add_anno_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
404 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
405 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
406 call assert_equal('send: 2:addAnno!62 1 1 2/1 0', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
407 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
408 call assert_equal([{'lnum': 2, 'id': 1, 'name': '1', 'priority': 10,
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
409 \ 'group': ''}], sign_getplaced()[0].signs)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
410 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
411
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
412 " getAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
413 call appendbufline(cmdbufnr, '$', 'get_anno_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
414 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
415 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
416 call assert_equal(['send: 2:getAnno/63 1', '63 2'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
417 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
418
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
419 " removeAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
420 call appendbufline(cmdbufnr, '$', 'remove_anno_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
421 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
422 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
423 call assert_equal('send: 2:removeAnno!64 1', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
424 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
425 call assert_equal([], sign_getplaced())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
426 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
427
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
428 " getModified test to get the number of modified buffers
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
429 call appendbufline(cmdbufnr, '$', 'getModifiedAll_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
430 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
431 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
432 call assert_equal(['send: 0:getModified/65', '65 2'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
433 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
434
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
435 let bufcount = len(getbufinfo())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
436
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
437 " create test to create a new buffer
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
438 call appendbufline(cmdbufnr, '$', 'create_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
439 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
440 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
441 call assert_equal('send: 3:create!66', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
442 " Wait for vim to process the previous netbeans message
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
443 sleep 10m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
444 call assert_equal(bufcount + 1, len(getbufinfo()))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
445 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
446
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
447 " setTitle test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
448 call appendbufline(cmdbufnr, '$', 'setTitle_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
449 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
450 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
451 call assert_equal('send: 3:setTitle!67 "Xfile4"', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
452 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
453
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
454 " setFullName test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
455 call appendbufline(cmdbufnr, '$', 'setFullName_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
456 call WaitFor('len(ReadXnetbeans()) >= (g:last + 5)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
457 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
458 call assert_equal('send: 3:setFullName!68 "Xfile4"', l[-3])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
459 call assert_match('0:fileOpened=0 ".*/Xfile4" T F', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
460 call assert_equal('Xfile4', bufname())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
461 let g:last += 5
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
462
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
463 " initDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
464 call appendbufline(cmdbufnr, '$', 'initDone_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
465 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
466 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
467 call assert_equal('send: 3:initDone!69', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
468 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
469
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
470 " setVisible test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
471 hide enew
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
472 call appendbufline(cmdbufnr, '$', 'setVisible_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
473 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
474 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
475 call assert_equal('send: 3:setVisible!70 T', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
476 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
477
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
478 " setModtime test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
479 call appendbufline(cmdbufnr, '$', 'setModtime_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
480 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
481 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
482 call assert_equal('send: 3:setModtime!71 6', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
483 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
484
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
485 " insert test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
486 call appendbufline(cmdbufnr, '$', 'insert_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
487 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
488 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
489 call assert_equal(['send: 3:insert/72 0 "line1\nline2\n"', '72'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
490 call assert_equal(['line1', 'line2'], getline(1, '$'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
491 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
492
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
493 " remove test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
494 call appendbufline(cmdbufnr, '$', 'remove_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
495 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
496 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
497 call assert_equal(['send: 3:remove/73 3 4', '73'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
498 call assert_equal(['linine2'], getline(1, '$'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
499 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
500
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
501 " remove with invalid offset
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
502 call appendbufline(cmdbufnr, '$', 'remove_invalid_offset_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
503 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
504 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
505 call assert_equal(['send: 3:remove/74 900 4', '74 !bad position'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
506 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
507
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
508 " remove with invalid count
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
509 call appendbufline(cmdbufnr, '$', 'remove_invalid_count_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
510 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
511 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
512 call assert_equal(['send: 3:remove/75 1 800', '75 !bad count'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
513 let g:last += 4
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
514
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
515 " guard test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
516 %d
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
517 call setline(1, ['foo bar', 'foo bar', 'foo bar'])
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
518 call WaitFor('len(ReadXnetbeans()) >= (g:last + 8)')
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
519 let g:last += 8
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
520
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
521 call appendbufline(cmdbufnr, '$', 'guard_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
522 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
523 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
524 call assert_equal('send: 3:guard!76 8 7', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
525 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
526 " second line is guarded. Try modifying the line
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
527 call assert_fails('normal 2GIbaz', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
528 call assert_fails('normal 2GAbaz', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
529 call assert_fails('normal dd', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
530 call assert_equal([{'name': '1', 'texthl': 'NB_s1', 'text': '=>'},
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
531 \ {'name': '10000', 'linehl': 'NBGuarded'}],
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
532 \ sign_getdefined())
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
533 let s = sign_getplaced()[0].signs[0]
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
534 call assert_equal(2, s.lnum)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
535 call assert_equal('10000', s.name)
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
536 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
537
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
538 " setModified test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
539 call appendbufline(cmdbufnr, '$', 'setModified_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
540 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
541 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
542 call assert_equal('send: 3:setModified!77 T', l[-1])
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
543 sleep 1m
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
544 call assert_equal(1, &modified)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
545 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
546
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
547 " clear setModified test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
548 call appendbufline(cmdbufnr, '$', 'setModifiedClear_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
549 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
550 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
551 call assert_equal('send: 3:setModified!77 F', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
552 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
553 call assert_equal(0, &modified)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
554 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
555
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
556 " insertDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
557 let v:statusmsg = ''
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
558 call appendbufline(cmdbufnr, '$', 'insertDone_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
559 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
560 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
561 call assert_equal('send: 3:insertDone!78 T F', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
562 sleep 1m
21154
9f9c26b3ddc5 patch 8.2.1128: the write message mentions characters, but it's bytes
Bram Moolenaar <Bram@vim.org>
parents: 20625
diff changeset
563 call assert_match('.*/Xfile4" 3L, 0B', v:statusmsg)
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
564 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
565
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
566 " saveDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
567 let v:statusmsg = ''
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
568 call appendbufline(cmdbufnr, '$', 'saveDone_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
569 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
570 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
571 call assert_equal('send: 3:saveDone!79', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
572 sleep 1m
21154
9f9c26b3ddc5 patch 8.2.1128: the write message mentions characters, but it's bytes
Bram Moolenaar <Bram@vim.org>
parents: 20625
diff changeset
573 call assert_match('.*/Xfile4" 3L, 0B', v:statusmsg)
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
574 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
575
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
576 " unimplemented command test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
577 call appendbufline(cmdbufnr, '$', 'invalidcmd_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
578 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
579 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
580 call assert_equal('send: 3:invalidcmd!80', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
581 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
582
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
583 " unimplemented function test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
584 call appendbufline(cmdbufnr, '$', 'invalidfunc_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
585 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
586 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
587 call assert_equal(['send: 3:invalidfunc/81', '81'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
588 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
589
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
590 " Test for removeAnno cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
591 call appendbufline(cmdbufnr, '$', 'removeAnno_fail_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
592 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
593 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
594 call assert_equal(['send: 0:removeAnno/82 1', '82'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
595 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
596
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
597 " Test for guard cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
598 call appendbufline(cmdbufnr, '$', 'guard_fail_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
599 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
600 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
601 call assert_equal(['send: 0:guard/83 1 1', '83'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
602 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
603
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
604 " Test for save cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
605 call appendbufline(cmdbufnr, '$', 'save_fail_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
606 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
607 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
608 call assert_equal(['send: 0:save/84', '84'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
609 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
610
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
611 " Test for netbeansBuffer cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
612 call appendbufline(cmdbufnr, '$', 'netbeansBuffer_fail_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
613 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
614 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
615 call assert_equal(['send: 0:netbeansBuffer/85 T', '85'], l[-2:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
616 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
617
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
618 " nbkey test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
619 call cursor(3, 3)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
620 nbkey "\<C-F2>"
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
621 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
622 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
623 call assert_equal(['3:newDotAndMark=85 18 18',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
624 \ '3:keyCommand=85 ""\<C-F2>""',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
625 \ '3:keyAtPos=85 ""\<C-F2>"" 18 3/2'], l[-3:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
626 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
627
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
628 " setExitDelay test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
629 call appendbufline(cmdbufnr, '$', 'setExitDelay_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
630 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
631 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
632 call assert_equal('send: 0:setExitDelay!86 2', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
633 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
634
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
635 " setReadonly test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
636 call appendbufline(cmdbufnr, '$', 'setReadOnly_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
637 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
638 let l = ReadXnetbeans()
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
639 call assert_equal('send: 3:setReadOnly!87 T', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
640 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
641 call assert_equal(1, &readonly)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
642 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
643
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
644 " clear setReadonly test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
645 call appendbufline(cmdbufnr, '$', 'setReadOnlyClear_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
646 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
647 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
648 call assert_equal('send: 3:setReadOnly!88 F', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
649 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
650 call assert_equal(0, &readonly)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
651 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
652
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
653 " save test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
654 call setbufvar(bufnr('Xfile4'), '&modified', 1)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
655 call appendbufline(cmdbufnr, '$', 'save_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
656 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
657 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
658 call assert_equal('send: 3:save!89', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
659 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
660 call assert_true(filereadable('Xfile4'))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
661 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
662
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
663 " close test. Don't use buffer 10 after this
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
664 call appendbufline(cmdbufnr, '$', 'close_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
665 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
666 let l = ReadXnetbeans()
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
667 call assert_equal('send: 3:close!90', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
668 call assert_equal('3:killed=90', l[-1])
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
669 call assert_equal(1, winnr('$'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
670 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
671
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
672 " specialKeys test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
673 call appendbufline(cmdbufnr, '$', 'specialKeys_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
674 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
675 let l = ReadXnetbeans()
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
676 call assert_equal('send: 0:specialKeys!91 "F12 F13 C-F13"', l[-1])
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
677 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
678 call assert_equal(':nbkey F12<CR>', maparg('<F12>', 'n'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
679 call assert_equal(':nbkey F13<CR>', maparg('<F13>', 'n'))
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
680 call assert_equal(':nbkey C-F13<CR>', maparg('<C-F13>', 'n'))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
681 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
682
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
683 " Open a buffer not monitored by netbeans
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
684 enew | only!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
685 nbkey "\<C-F3>"
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
686 call WaitFor('len(ReadXnetbeans()) >= (g:last + 1)')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
687 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
688 call assert_equal('0:fileOpened=0 "" T F', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
689 let g:last += 1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
690
20625
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
691 " Test for writing a netbeans buffer
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
692 call appendbufline(cmdbufnr, '$', 'nbbufwrite_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
693 call WaitFor('len(ReadXnetbeans()) >= (g:last + 5)')
20625
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
694 call assert_fails('write', 'E656:')
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
695 call setline(1, ['one', 'two'])
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
696 call assert_fails('1write!', 'E657:')
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
697 write
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
698 call WaitFor('len(ReadXnetbeans()) >= (g:last + 10)')
20625
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
699 let g:last += 10
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
700
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
701 if has('mouse')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
702 " Test for mouse button release
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
703 let save_mouse = &mouse
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
704 set mouse=a
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
705 call feedkeys("\<LeftMouse>\<LeftRelease>", 'xt')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
706 let &mouse = save_mouse
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
707 call WaitFor('len(ReadXnetbeans()) >= (g:last + 2)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
708 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
709 call assert_equal('4:newDotAndMark=93 0 0', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
710 call assert_equal('4:buttonRelease=93 0 1 -1', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
711 let g:last += 2
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
712 endif
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
713
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
714 " Test for startAtomic
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
715 call appendbufline(cmdbufnr, '$', 'startAtomic_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
716 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
717 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
718 call assert_equal('send: 0:startAtomic!94', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
719 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
720
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
721 " Test for endAtomic
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
722 call appendbufline(cmdbufnr, '$', 'endAtomic_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
723 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
724 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
725 call assert_equal('send: 0:endAtomic!95', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
726 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
727
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
728 " Test for invoking a netbeans key binding
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
729 let special_keys = [
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
730 \ ["\<F1>", 'F1'], ["\<S-F1>", 'S-F1'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
731 \ ["\<F2>", 'F2'], ["\<S-F2>", 'S-F2'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
732 \ ["\<F3>", 'F3'], ["\<S-F3>", 'S-F3'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
733 \ ["\<F4>", 'F4'], ["\<S-F4>", 'S-F4'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
734 \ ["\<F5>", 'F5'], ["\<S-F5>", 'S-F5'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
735 \ ["\<F6>", 'F6'], ["\<S-F6>", 'S-F6'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
736 \ ["\<F7>", 'F7'], ["\<S-F7>", 'S-F7'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
737 \ ["\<F8>", 'F8'], ["\<S-F8>", 'S-F8'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
738 \ ["\<F9>", 'F9'], ["\<S-F9>", 'S-F9'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
739 \ ["\<F11>", 'F11'], ["\<S-F11>", 'S-F11'],
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
740 \ ["\<F12>", 'F12'], ["\<S-F12>", 'S-F12'], ['!', '!']
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
741 \ ]
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
742 for [key, name] in special_keys
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
743 call feedkeys("\<F21>" .. key, 'xt')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
744 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
745 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
746 call assert_match('4:keyCommand=\d\+ "' .. name .. '"', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
747 call assert_match('4:keyAtPos=\d\+ "' .. name .. '" 0 1/0', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
748 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
749 endfor
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
750 call feedkeys("\<F21>\<C-S-M-F9>", 'xt')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
751 call WaitFor('len(ReadXnetbeans()) >= (g:last + 3)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
752 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
753 call assert_match('4:keyCommand=\d\+ "CSM-F9"', l[-2])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
754 call assert_match('4:keyAtPos=\d\+ "CSM-F9" 0 1/0', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
755 let g:last += 3
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
756
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
757 if has('signs') && has('mouse')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
758 sign define S1 linehl=Search text==>
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
759 sign define S2 linehl=ErrorMsg text=!!
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
760 sign place 10 line=1 name=S1
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
761 sign place 20 line=1 name=S2
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
762
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
763 let save_mouse = &mouse
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
764 set mouse=a
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
765 call assert_equal('S2', sign_getplaced()[0].signs[0].name)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
766 call test_setmouse(1, 1)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
767 call feedkeys("\<LeftMouse>\<LeftRelease>", 'xt')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
768 call assert_equal('S1', sign_getplaced()[0].signs[0].name)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
769 call test_setmouse(1, 1)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
770 call feedkeys("\<LeftMouse>\<LeftRelease>", 'xt')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
771 call assert_equal('S2', sign_getplaced()[0].signs[0].name)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
772 let &mouse = save_mouse
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
773
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
774 sign unplace 10
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
775 sign unplace 20
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
776 sign undefine S1
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
777 sign undefine S2
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
778 endif
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
779
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
780 " define a large number of annotations
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
781 call appendbufline(cmdbufnr, '$', 'AnnoScale_Test')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
782 call WaitFor('len(ReadXnetbeans()) >= (g:last + 26)')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
783 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
784 call assert_equal('2:defineAnnoType!60 25 "s25" "x" "=>" blue none', l[-1])
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
785 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
786 call assert_true(len(sign_getdefined()) >= 25)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
787 let g:last += 26
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
788
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
789 " detach
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
790 call appendbufline(cmdbufnr, '$', 'detach_Test')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
791 call WaitFor('len(ReadXnetbeans()) >= (g:last + 8)')
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
792 call WaitForAssert({-> assert_equal('0:disconnect=97', ReadXnetbeans()[-1])})
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
793
20390
8bbb8f0b6f9c patch 8.2.0750: netbeans test is a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 20087
diff changeset
794 " the connection was closed
10253
a92c4abb8c1f commit https://github.com/vim/vim/commit/8ddef48d1eade1911b946fdda8c73c80856e6273
Christian Brabandt <cb@256bit.org>
parents: 10162
diff changeset
795 call assert_false(has("netbeans_enabled"))
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
796
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
797 " Remove all the signs
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
798 call sign_unplace('*')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
799 call sign_undefine()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
800
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
801 call delete("Xnetbeans")
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
802 call delete('Xfile1')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
803 call delete('Xfile3')
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
804 call delete('Xfile4')
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
805 endfunc
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
806
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
807 func Test_nb_basic()
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
808 call ch_log('Test_nb_basic')
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
809 call s:run_server('Nb_basic')
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
810 endfunc
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
811
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
812 func Nb_file_auth(port)
12742
af961e38e508 patch 8.0.1249: no error when WaitFor() gets an invalid wrong expression
Christian Brabandt <cb@256bit.org>
parents: 12734
diff changeset
813 call delete("Xnetbeans")
af961e38e508 patch 8.0.1249: no error when WaitFor() gets an invalid wrong expression
Christian Brabandt <cb@256bit.org>
parents: 12734
diff changeset
814 call writefile([], "Xnetbeans")
af961e38e508 patch 8.0.1249: no error when WaitFor() gets an invalid wrong expression
Christian Brabandt <cb@256bit.org>
parents: 12734
diff changeset
815
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
816 call assert_fails('nbstart =notexist', 'E660:')
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
817 call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth')
9603
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
818 if has('unix')
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
819 call setfperm('Xnbauth', "rw-r--r--")
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
820 call assert_fails('nbstart =Xnbauth', 'E668:')
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
821 endif
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
822 call setfperm('Xnbauth', "rw-------")
9996
c2968473c8dc commit https://github.com/vim/vim/commit/ffdf08c94e16b0813862bdfdbc1c92892d2e4c93
Christian Brabandt <cb@256bit.org>
parents: 9663
diff changeset
823 exe 'nbstart =Xnbauth'
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
824 call assert_true(has("netbeans_enabled"))
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
825
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
826 call WaitFor('len(ReadXnetbeans()) > 2')
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
827 nbclose
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
828 let lines = ReadXnetbeans()
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
829 call assert_equal('AUTH bunny', lines[0])
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
830 call assert_equal('0:version=0 "2.5"', lines[1])
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
831 call assert_equal('0:startupDone=0', lines[2])
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
832
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
833 call delete("Xnbauth")
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
834 call delete("Xnetbeans")
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
835 endfunc
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
836
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
837 func Test_nb_file_auth()
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
838 call ch_log('Test_nb_file_auth')
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
839 call s:run_server('Nb_file_auth')
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
840 endfunc
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
841
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
842 " Test for quiting Vim with an open netbeans connection
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
843 func Nb_quit_with_conn(port)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
844 call delete("Xnetbeans")
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
845 call writefile([], "Xnetbeans")
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
846 let after =<< trim END
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
847 source shared.vim
22827
20ccf5f7dc6d patch 8.2.1961: various comments can be improved
Bram Moolenaar <Bram@vim.org>
parents: 22792
diff changeset
848 set cpo&vim
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
849
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
850 func ReadXnetbeans()
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
851 let l = readfile("Xnetbeans")
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
852 return filter(l, 'v:val !~ "^0:geometry="')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
853 endfunc
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
854
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
855 " Establish the connection with the netbeans server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
856 exe 'nbstart :localhost:' .. g:port .. ':star'
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
857 call assert_true(has("netbeans_enabled"))
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
858 call WaitFor('len(ReadXnetbeans()) >= 3')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
859 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
860 call assert_equal(['AUTH star',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
861 \ '0:version=0 "2.5"',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
862 \ '0:startupDone=0'], l[-3:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
863
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
864 " Open the command buffer to communicate with the server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
865 split Xcmdbuf
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
866 call WaitFor('len(ReadXnetbeans()) >= 6')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
867 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
868 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
869 \ substitute(l[-3], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
870 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
871 \ substitute(l[-2], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
872 call assert_equal('1:startDocumentListen!16', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
873 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
874
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
875 quit!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
876 quit!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
877 END
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
878 if RunVim(['let g:port = ' .. a:port], after, '')
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
879 call WaitFor('len(ReadXnetbeans()) >= 9')
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
880 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
881 call assert_equal('1:unmodified=16', l[-3])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
882 call assert_equal('1:killed=16', l[-2])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
883 call assert_equal('0:disconnect=16', l[-1])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
884 endif
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
885 call delete('Xnetbeans')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
886 endfunc
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
887
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
888 func Test_nb_quit_with_conn()
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
889 " Exiting Vim with a netbeans connection doesn't work properly on
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
890 " MS-Windows.
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
891 CheckUnix
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
892 call s:run_server('Nb_quit_with_conn')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
893 endfunc
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
894
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
895 func Nb_bwipe_buffer(port)
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
896 call delete("Xnetbeans")
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
897 call writefile([], "Xnetbeans")
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
898
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
899 " Last line number in the Xnetbeans file. Used to verify the result of the
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
900 " communication with the netbeans server
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
901 let g:last = 0
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
902
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
903 " Establish the connection with the netbeans server
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
904 exe 'nbstart :localhost:' .. a:port .. ':bunny'
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
905 call WaitFor('len(ReadXnetbeans()) > (g:last + 2)')
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
906 let l = ReadXnetbeans()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
907 call assert_equal(['AUTH bunny',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
908 \ '0:version=0 "2.5"',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
909 \ '0:startupDone=0'], l[-3:])
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
910 let g:last += 3
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
911
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
912 " Open the command buffer to communicate with the server
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
913 split Xcmdbuf
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
914 call WaitFor('len(ReadXnetbeans()) > (g:last + 2)')
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
915 let l = ReadXnetbeans()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
916 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
917 \ substitute(l[-3], '".*/', '"', ''))
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
918 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
919 \ substitute(l[-2], '".*/', '"', ''))
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
920 call assert_equal('1:startDocumentListen!16', l[-1])
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
921 let g:last += 3
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
922
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
923 sleep 10m
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
924 endfunc
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
925
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
926 " This test used to reference a buffer after it was freed leading to an ASAN
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
927 " error.
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
928 func Test_nb_bwipe_buffer()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
929 call s:run_server('Nb_bwipe_buffer')
22892
d3afe009826a patch 8.2.1993: occasional failure of the netbeans test
Bram Moolenaar <Bram@vim.org>
parents: 22830
diff changeset
930 silent! %bwipe!
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
931 sleep 100m
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
932 nbclose
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
933 endfunc
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
934
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
935 " vim: shiftwidth=2 sts=2 expandtab