annotate src/testdir/test_netbeans.vim @ 29189:d1e263ecf634 v8.2.5114

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