annotate src/testdir/test_netbeans.vim @ 35308:22c03485f222 v9.1.0456

patch 9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 Commit: https://github.com/vim/vim/commit/88d4f255b7b7a19bb4f6489e0ad0956e47d51fed Author: Gary Johnson <garyjohn@spocom.com> Date: Sat Jun 1 20:51:33 2024 +0200 patch 9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 Problem: Left shift is incorrect with vartabstop and shiftwidth=0 Solution: make tabstop_at() function aware of shift direction (Gary Johnson) The problem was that with 'vartabstop' set and 'shiftwidth' equal 0, left shifts using << were shifting the line to the wrong column. The tabstop to the right of the first character in the line was being used as the shift amount instead of the tabstop to the left of that first character. The reason was that the tabstop_at() function always returned the value of the tabstop to the right of the given column and was not accounting for the direction of the shift. The solution was to make tabstop_at() aware of the direction of the shift and to choose the tabtop accordingly. A test was added to check this behavior and make sure it doesn't regress. While at it, also fix a few indentation/alignment issues. fixes: #14864 closes: #14887 Signed-off-by: Gary Johnson <garyjohn@spocom.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 01 Jun 2024 21:00:03 +0200
parents 8492bbc9f533
children
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)
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
44 call writefile([], "Xnetbeans", 'D')
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
45
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
46 " 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
47 " communication with the netbeans server
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
48 let g:last = 0
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
49
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
50 " 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
51 exe 'nbstart :localhost:' .. a:port .. ':bunny'
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 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
53 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
54 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
55 call assert_equal(['AUTH bunny',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
56 \ '0:version=0 "2.5"',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
57 \ '0:startupDone=0'], l[-3:])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
58 let g:last += 3
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
60 " 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
61 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
62
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
63 " 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
64 split Xcmdbuf
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
65 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
66 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
67 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
68 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
69 \ substitute(l[-3], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
70 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
71 \ substitute(l[-2], '".*/', '"', ''))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
72 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
73 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
74
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
75 " 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
76 hide
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
77
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
78 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
79
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
80 " getCursor test
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
81 call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1', 'D')
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
82 split Xfile1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
83 call cursor(3, 4)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
84 sleep 10m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
85 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
86 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
87 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
88 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
89 let g:last += 5
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
90
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
91 " Test for E627
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
92 call appendbufline(cmdbufnr, '$', 'E627_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
93 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
94 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
95 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
96 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
97 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
98
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
99 " Test for E628
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
100 call appendbufline(cmdbufnr, '$', 'E628_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
101 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
102 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
103 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
104 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
105 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
106
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
107 " Test for E632
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
108 call appendbufline(cmdbufnr, '$', 'E632_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
109 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
110 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
111 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
112 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
113 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
114
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
115 " Test for E633
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
116 call appendbufline(cmdbufnr, '$', 'E633_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
117 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
118 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
119 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
120 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
121 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
122
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
123 " Test for E634
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
124 call appendbufline(cmdbufnr, '$', 'E634_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
125 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
126 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
127 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
128 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
129 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
130
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
131 " Test for E635
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
132 call appendbufline(cmdbufnr, '$', 'E635_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
133 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
134 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
135 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
136 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
137 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
138
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
139 " Test for E636
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
140 call appendbufline(cmdbufnr, '$', 'E636_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
141 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
142 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
143 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
144 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
145 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
146
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
147 " Test for E637
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
148 call appendbufline(cmdbufnr, '$', 'E637_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
149 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
150 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
151 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
152 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
153 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
154
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
155 " Test for E638
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
156 call appendbufline(cmdbufnr, '$', 'E638_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
157 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
158 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
159 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
160 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
161 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
162
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
163 " Test for E639
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
164 call appendbufline(cmdbufnr, '$', 'E639_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
165 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
166 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
167 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
168 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
169 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
170
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
171 " Test for E640
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
172 call appendbufline(cmdbufnr, '$', 'E640_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
173 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
174 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
175 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
176 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
177 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
178
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
179 " Test for E641
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
180 call appendbufline(cmdbufnr, '$', 'E641_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
181 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
182 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
183 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
184 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
185 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
186
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
187 " Test for E642
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
188 call appendbufline(cmdbufnr, '$', 'E642_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
189 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
190 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
191 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
192 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
193 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
194
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
195 " Test for E643
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
196 call appendbufline(cmdbufnr, '$', 'E643_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
197 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
198 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
199 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
200 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
201 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
202
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
203 enew!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
204
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
205 " Test for E644
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
206 call appendbufline(cmdbufnr, '$', 'E644_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
207 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
208 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
209 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
210 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
211 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
212
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
213 " 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
214 call appendbufline(cmdbufnr, '$', 'E645_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
215 set verbose=1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
216 call WaitForError('E645:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
217 set verbose&
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
218 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
219 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
220 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
221 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
222
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
223 " 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
224 call appendbufline(cmdbufnr, '$', 'E646_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
225 set verbose=1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
226 call WaitForError('E646:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
227 set verbose&
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
228 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
229 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
230 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
231 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
232
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
233 " Test for E647
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
234 call appendbufline(cmdbufnr, '$', 'E647_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
235 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
236 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
237 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
238 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
239 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
240
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
241 " Test for E648
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
242 call appendbufline(cmdbufnr, '$', 'E648_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
243 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
244 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
245 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
246 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
247 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
248
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
249 " Test for E650
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
250 call appendbufline(cmdbufnr, '$', 'E650_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
251 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
252 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
253 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
254 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
255 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
256
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
257 " Test for E651
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
258 call appendbufline(cmdbufnr, '$', 'E651_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
259 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
260 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
261 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
262 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
263 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
264
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
265 " Test for E652
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
266 call appendbufline(cmdbufnr, '$', 'E652_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
267 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
268 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
269 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
270 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
271 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
272
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
273 " editFile test
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
274 call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3', 'D')
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
275 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
276 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
277 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
278 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
279 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
280 call assert_equal('Xfile3', bufname())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
281 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
282
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
283 " getLength test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
284 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
285 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
286 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
287 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
288 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
289
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
290 " getModified test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
291 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
292 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
293 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
294 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
295 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
296
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
297 " getText test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
298 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
299 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
300 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
301 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
302 \ '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
303 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
304
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
305 " 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
306 call cursor(1, 1)
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
307 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
308 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
309 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
310 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
311 sleep 10m
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
312 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
313 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
314
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
315 " 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
316 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
317 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
318 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
319 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
320 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
321 sleep 10m
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
322 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
323 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
324
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
325 " startDocumentListen test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
326 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
327 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
328 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
329 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
330 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
331
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
332 " 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
333 " received the notifications
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
334 call append(2, 'blue sky')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
335 1d
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
336 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
337 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
338 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
339 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
340 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
341 let g:last += 3
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
342
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
343 " 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
344 set whichwrap+=~
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
345 normal 2G$~
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
346 set whichwrap&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
347 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
348 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
349 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
350 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
351 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
352 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
353 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
354
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
355 " 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
356 " 'noexpandtab'
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
357 setlocal softtabstop=4
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
358 setlocal noexpandtab
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
359 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
360 setlocal expandtab&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
361 setlocal softtabstop&
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
362 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
363 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
364 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
365 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
366 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
367 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
368
24756
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
369 " Test for changing case of multiple lines using ~
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
370 normal ggVG~
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
371 call WaitFor('len(ReadXnetbeans()) >= (g:last + 6)')
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
372 let l = ReadXnetbeans()
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
373 call assert_match('2:remove=\d\+ 0 8', l[-6])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
374 call assert_match('2:insert=\d\+ 0 "FOO BAR2"', l[-5])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
375 call assert_match('2:remove=\d\+ 9 8', l[-4])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
376 call assert_match('2:insert=\d\+ 9 "BLUE SKy"', l[-3])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
377 call assert_match('2:remove=\d\+ 18 9', l[-2])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
378 call assert_match('2:insert=\d\+ 18 "\tFOO BAR3"', l[-1])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
379 let g:last += 6
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
380
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
381 " Test for changing case of a visual block using ~
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
382 exe "normal ggw\<C-V>$~"
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
383 call WaitFor('len(ReadXnetbeans()) >= (g:last + 2)')
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
384 let l = ReadXnetbeans()
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
385 call assert_match('2:remove=\d\+ 4 4', l[-2])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
386 call assert_match('2:insert=\d\+ 4 "bar2"', l[-1])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
387 let g:last += 2
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
388
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
389 " Increment a number using <C-A> in visual mode
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
390 exe "normal! gg$v6\<C-A>"
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
391 call WaitFor('len(ReadXnetbeans()) >= (g:last + 6)')
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
392 let l = ReadXnetbeans()
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
393 call assert_match('2:remove=\d\+ 0 9', l[-4])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
394 call assert_match('2:insert=\d\+ 0 "FOO bar8"', l[-3])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
395 call assert_match('2:remove=\d\+ 7 1', l[-2])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
396 call assert_match('2:insert=\d\+ 7 "8"', l[-1])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
397 let g:last += 6
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
398
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
399 " Decrement a number using <C-X> in visual mode
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
400 exe "normal! gg$v3\<C-X>"
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
401 call WaitFor('len(ReadXnetbeans()) >= (g:last + 6)')
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
402 let l = ReadXnetbeans()
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
403 call assert_match('2:remove=\d\+ 0 9', l[-4])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
404 call assert_match('2:insert=\d\+ 0 "FOO bar5"', l[-3])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
405 call assert_match('2:remove=\d\+ 7 1', l[-2])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
406 call assert_match('2:insert=\d\+ 7 "5"', l[-1])
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
407 let g:last += 6
ac7ad168caed patch 8.2.2916: operators are not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
408
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
409 " stopDocumentListen test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
410 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
411 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
412 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
413 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
414 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
415
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
416 " 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
417 sleep 1m
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 " 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
420 call append(2, 'clear sky')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
421 1d
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
422
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
423 " defineAnnoType test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
424 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
425 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
426 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
427 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
428 sleep 1m
20390
8bbb8f0b6f9c patch 8.2.0750: netbeans test is a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 20087
diff changeset
429 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
430 \ sign_getdefined()->get(0, {}))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
431 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
432
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
433 " defineAnnoType with a long color name
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
434 call appendbufline(cmdbufnr, '$', 'E532_Test')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
435 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
436 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
437 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
438 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
439 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
440
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
441 " addAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
442 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
443 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
444 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
445 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
446 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
447 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
448 \ 'group': ''}], sign_getplaced()[0].signs)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
449 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
450
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
451 " getAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
452 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
453 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
454 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
455 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
456 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
457
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
458 " removeAnno test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
459 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
460 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
461 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
462 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
463 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
464 call assert_equal([], sign_getplaced())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
465 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
466
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
467 " 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
468 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
469 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
470 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
471 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
472 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
473
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
474 let bufcount = len(getbufinfo())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
475
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
476 " 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
477 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
478 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
479 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
480 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
481 " 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
482 sleep 10m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
483 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
484 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
485
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
486 " setTitle test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
487 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
488 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
489 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
490 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
491 let g:last += 3
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 " setFullName test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
494 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
495 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
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:setFullName!68 "Xfile4"', l[-3])
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
498 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
499 call assert_equal('Xfile4', bufname())
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
500 let g:last += 5
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
501
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
502 " initDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
503 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
504 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
505 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
506 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
507 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
508
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
509 " setVisible test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
510 hide enew
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
511 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
512 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
513 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
514 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
515 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
516
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
517 " setModtime test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
518 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
519 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
520 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
521 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
522 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
523
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
524 " insert test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
525 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
526 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
527 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
528 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
529 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
530 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
531
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
532 " remove test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
533 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
534 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
535 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
536 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
537 call assert_equal(['linine2'], getline(1, '$'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
538 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
539
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
540 " remove with invalid offset
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
541 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
542 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
543 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
544 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
545 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
546
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
547 " remove with invalid count
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
548 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
549 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
550 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
551 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
552 let g:last += 4
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
553
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
554 " guard test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
555 %d
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
556 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
557 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
558 let g:last += 8
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
559
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
560 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
561 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
562 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
563 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
564 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
565 " 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
566 call assert_fails('normal 2GIbaz', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
567 call assert_fails('normal 2GAbaz', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
568 call assert_fails('normal dd', 'E463:')
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
569 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
570 \ {'name': '10000', 'linehl': 'NBGuarded'}],
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
571 \ sign_getdefined())
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
572 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
573 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
574 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
575 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
576
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
577 " setModified test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
578 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
579 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
580 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
581 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
582 sleep 1m
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
583 call assert_equal(1, &modified)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
584 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
585
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
586 " clear setModified test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
587 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
588 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
589 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
590 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
591 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
592 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
593 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
594
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
595 " insertDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
596 let v:statusmsg = ''
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
597 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
598 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
599 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
600 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
601 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
602 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
603 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
604
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
605 " saveDone test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
606 let v:statusmsg = ''
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
607 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
608 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
609 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
610 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
611 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
612 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
613 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
614
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
615 " unimplemented command test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
616 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
617 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
618 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
619 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
620 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
621
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
622 " unimplemented function test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
623 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
624 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
625 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
626 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
627 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
628
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
629 " Test for removeAnno cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
630 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
631 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
632 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
633 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
634 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
635
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
636 " Test for guard cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
637 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
638 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
639 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
640 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
641 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
642
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
643 " Test for save cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
644 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
645 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
646 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
647 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
648 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
649
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
650 " Test for netbeansBuffer cmd failure
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
651 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
652 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
653 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
654 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
655 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
656
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
657 " nbkey test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
658 call cursor(3, 3)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
659 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
660 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
661 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
662 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
663 \ '3:keyCommand=85 ""\<C-F2>""',
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
664 \ '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
665 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
666
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
667 " setExitDelay test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
668 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
669 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
670 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
671 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
672 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
673
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
674 " setReadonly test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
675 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
676 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
677 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
678 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
679 sleep 1m
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(1, &readonly)
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
681 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
682
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
683 " clear setReadonly test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
684 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
685 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
686 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
687 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
688 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
689 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
690 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
691
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
692 " save test
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
693 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
694 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
695 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
696 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
697 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
698 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
699 call assert_true(filereadable('Xfile4'))
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
700 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
701
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
702 " 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
703 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
704 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
705 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
706 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
707 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
708 call assert_equal(1, winnr('$'))
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
709 let g:last += 4
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
710
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
711 " specialKeys test
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
712 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
713 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
714 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
715 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
716 sleep 1m
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
717 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
718 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
719 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
720 let g:last += 3
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
721
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
722 " 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
723 enew | only!
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
724 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
725 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
726 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
727 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
728 let g:last += 1
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
729
20625
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
730 " 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
731 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
732 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
733 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
734 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
735 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
736 write
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
737 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
738 let g:last += 10
116c7bd5e980 patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents: 20464
diff changeset
739
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
740 if has('mouse')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
741 " 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
742 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
743 set mouse=a
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
744 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
745 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
746 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
747 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
748 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
749 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
750 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
751 endif
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
752
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
753 " Test for startAtomic
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
754 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
755 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
756 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
757 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
758 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
759
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
760 " Test for endAtomic
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
761 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
762 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
763 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
764 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
765 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
766
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
767 " 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
768 let special_keys = [
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
769 \ ["\<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
770 \ ["\<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
771 \ ["\<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
772 \ ["\<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
773 \ ["\<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
774 \ ["\<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
775 \ ["\<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
776 \ ["\<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
777 \ ["\<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
778 \ ["\<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
779 \ ["\<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
780 \ ]
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
781 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
782 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
783 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
784 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
785 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
786 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
787 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
788 endfor
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
789 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
790 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
791 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
792 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
793 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
794 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
795
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
796 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
797 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
798 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
799 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
800 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
801
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
802 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
803 set mouse=a
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
804 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
805 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
806 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
807 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
808 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
809 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
810 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
811 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
812
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
813 sign unplace 10
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
814 sign unplace 20
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
815 sign undefine S1
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
816 sign undefine S2
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
817 endif
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
818
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
819 " 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
820 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
821 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
822 let l = ReadXnetbeans()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
823 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
824 sleep 1m
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
825 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
826 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
827
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
828 " detach
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
829 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
830 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
831 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
832
20390
8bbb8f0b6f9c patch 8.2.0750: netbeans test is a bit flaky
Bram Moolenaar <Bram@vim.org>
parents: 20087
diff changeset
833 " the connection was closed
10253
a92c4abb8c1f commit https://github.com/vim/vim/commit/8ddef48d1eade1911b946fdda8c73c80856e6273
Christian Brabandt <cb@256bit.org>
parents: 10162
diff changeset
834 call assert_false(has("netbeans_enabled"))
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
835
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
836 " 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
837 call sign_unplace('*')
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
838 call sign_undefine()
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
839
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 21395
diff changeset
840 call delete('Xfile4')
9517
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
841 endfunc
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
842
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
843 func Test_nb_basic()
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
844 call ch_log('Test_nb_basic')
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
845 call s:run_server('Nb_basic')
9f8f03a44886 commit https://github.com/vim/vim/commit/321efdd77a7b9ac11ade90dd7634b5d37f4820fe
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
846 endfunc
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
847
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
848 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
849 call delete("Xnetbeans")
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
850 call writefile([], "Xnetbeans", 'D')
12742
af961e38e508 patch 8.0.1249: no error when WaitFor() gets an invalid wrong expression
Christian Brabandt <cb@256bit.org>
parents: 12734
diff changeset
851
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
852 call assert_fails('nbstart =notexist', 'E660:')
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
853 call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth', 'D')
9603
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
854 if has('unix')
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
855 call setfperm('Xnbauth', "rw-r--r--")
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
856 call assert_fails('nbstart =Xnbauth', 'E668:')
20e7be5d99ac commit https://github.com/vim/vim/commit/53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594
Christian Brabandt <cb@256bit.org>
parents: 9521
diff changeset
857 endif
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
858 call setfperm('Xnbauth', "rw-------")
9996
c2968473c8dc commit https://github.com/vim/vim/commit/ffdf08c94e16b0813862bdfdbc1c92892d2e4c93
Christian Brabandt <cb@256bit.org>
parents: 9663
diff changeset
859 exe 'nbstart =Xnbauth'
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
860 call assert_true(has("netbeans_enabled"))
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
861
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
862 call WaitFor('len(ReadXnetbeans()) > 2')
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
863 nbclose
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
864 let lines = ReadXnetbeans()
9521
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
865 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
866 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
867 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
868
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
869 call delete("Xnbauth")
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
870 endfunc
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
871
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
872 func Test_nb_file_auth()
820c8861d15c commit https://github.com/vim/vim/commit/603d657219154ef074eeb70f6892b0b54e4fc19b
Christian Brabandt <cb@256bit.org>
parents: 9517
diff changeset
873 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
874 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
875 endfunc
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
876
23229
b545334ae654 patch 8.2.2160: various typos
Bram Moolenaar <Bram@vim.org>
parents: 22892
diff changeset
877 " Test for quitting Vim with an open netbeans connection
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
878 func Nb_quit_with_conn(port)
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
879 call delete("Xnetbeans")
30582
72245f9c9405 patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents: 24756
diff changeset
880 call writefile([], "Xnetbeans", 'D')
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
881 let after =<< trim END
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
882 source shared.vim
22827
20ccf5f7dc6d patch 8.2.1961: various comments can be improved
Bram Moolenaar <Bram@vim.org>
parents: 22792
diff changeset
883 set cpo&vim
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
884
21395
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
885 func ReadXnetbeans()
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
886 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
887 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
888 endfunc
9fba6d987d32 patch 8.2.1248: Netbeans test is flaky in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 21154
diff changeset
889
31665
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
890 try
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
891 " Establish the connection with the netbeans server
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
892 exe 'nbstart :localhost:' .. g:port .. ':star'
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
893 call assert_true(has("netbeans_enabled"))
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
894 call WaitFor('len(ReadXnetbeans()) >= 3')
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
895 let l = ReadXnetbeans()
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
896 call assert_equal(['AUTH star',
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
897 \ '0:version=0 "2.5"',
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
898 \ '0:startupDone=0'], l[-3:])
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
899
31665
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
900 " Open the command buffer to communicate with the server
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
901 split Xcmdbuf
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
902 call WaitFor('len(ReadXnetbeans()) >= 6')
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
903 let l = ReadXnetbeans()
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
904 call assert_equal('0:fileOpened=0 "Xcmdbuf" T F',
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
905 \ substitute(l[-3], '".*/', '"', ''))
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
906 call assert_equal('send: 1:putBufferNumber!15 "Xcmdbuf"',
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
907 \ substitute(l[-2], '".*/', '"', ''))
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
908 call assert_equal('1:startDocumentListen!16', l[-1])
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
909 sleep 1m
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
910
31665
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
911 quit!
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
912 quit!
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
913 finally
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
914 qall!
8492bbc9f533 patch 9.0.1165: tests using IPv6 sometimes fail
Bram Moolenaar <Bram@vim.org>
parents: 30582
diff changeset
915 endtry
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
916 END
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
917 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
918 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
919 let l = ReadXnetbeans()
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
920 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
921 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
922 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
923 endif
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
924 endfunc
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
925
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
926 func Test_nb_quit_with_conn()
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
927 " 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
928 " MS-Windows.
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
929 CheckUnix
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
930 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
931 endfunc
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
932
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
933 func Nb_bwipe_buffer(port)
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
934 call delete("Xnetbeans")
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
935 call writefile([], "Xnetbeans")
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
936
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
937 " 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
938 " communication with the netbeans server
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
939 let g:last = 0
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
940
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
941 " 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
942 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
943 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
944 let l = ReadXnetbeans()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
945 call assert_equal(['AUTH bunny',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
946 \ '0:version=0 "2.5"',
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
947 \ '0:startupDone=0'], l[-3:])
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
948 let g:last += 3
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
949
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
950 " 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
951 split Xcmdbuf
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
952 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
953 let l = ReadXnetbeans()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
954 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
955 \ substitute(l[-3], '".*/', '"', ''))
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
956 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
957 \ substitute(l[-2], '".*/', '"', ''))
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
958 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
959 let g:last += 3
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
960
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
961 sleep 10m
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
962 endfunc
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
963
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
964 " 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
965 " error.
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
966 func Test_nb_bwipe_buffer()
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
967 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
968 silent! %bwipe!
22830
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
969 sleep 100m
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
970 nbclose
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
971 endfunc
70eb58639009 patch 8.2.1962: netbeans may access freed memory
Bram Moolenaar <Bram@vim.org>
parents: 22827
diff changeset
972
20087
b378f860d4ab patch 8.2.0599: Netbeans interface insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
973 " vim: shiftwidth=2 sts=2 expandtab