annotate src/testdir/test_termdebug.vim @ 33734:55e587f6b02f

runtime(termdebug): handle buffer-local mappings properly Commit: https://github.com/vim/vim/commit/7fbbd7fdc6df9dc198b3735cfbe8dbe8afd646f9 Author: shane.xb.qian <shane.qian@foxmail.com> Date: Wed Nov 8 21:44:48 2023 +0100 runtime(termdebug): handle buffer-local mappings properly closes: https://github.com/vim/vim/issues/13475 Signed-off-by: shane.xb.qian <shane.qian@foxmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Nov 2023 22:00:03 +0100
parents 5334aca4cef4
children c6e847116941
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for the termdebug plugin
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
3 source shared.vim
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 source check.vim
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 CheckUnix
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 CheckFeature terminal
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 CheckExecutable gdb
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 CheckExecutable gcc
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let g:GDB = exepath('gdb')
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 if g:GDB->empty()
33035
50fe2cd56d3a patch 9.0.1808: termdebug: Typo in termdebug test
Christian Brabandt <cb@256bit.org>
parents: 32998
diff changeset
13 throw 'Skipped: gdb is not found in $PATH'
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 endif
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let g:GCC = exepath('gcc')
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 if g:GCC->empty()
33035
50fe2cd56d3a patch 9.0.1808: termdebug: Typo in termdebug test
Christian Brabandt <cb@256bit.org>
parents: 32998
diff changeset
18 throw 'Skipped: gcc is not found in $PATH'
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 endif
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 packadd termdebug
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 func Test_termdebug_basic()
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 let lines =<< trim END
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 #include <stdio.h>
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 #include <stdlib.h>
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 int isprime(int n)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 {
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 if (n <= 1)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 return 0;
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 for (int i = 2; i <= n / 2; i++)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 if (n % i == 0)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 return 0;
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 return 1;
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 }
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 int main(int argc, char *argv[])
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 {
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 int n = 7;
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 printf("%d is %s prime\n", n, isprime(n) ? "a" : "not a");
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 return 0;
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 }
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 END
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 call writefile(lines, 'XTD_basic.c', 'D')
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 call system($'{g:GCC} -g -o XTD_basic XTD_basic.c')
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 edit XTD_basic.c
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 Termdebug ./XTD_basic
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
54 call WaitForAssert({-> assert_equal(3, winnr('$'))})
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 let gdb_buf = winbufnr(1)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 wincmd b
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 Break 9
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call term_wait(gdb_buf)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 redraw!
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call assert_equal([
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 \ 'priority': 110, 'group': 'TermDebug'}],
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 Run
33037
e937929e4bff patch 9.0.1809: termdebug test flayk
Christian Brabandt <cb@256bit.org>
parents: 33035
diff changeset
65 call term_wait(gdb_buf, 400)
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 redraw!
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
67 call WaitForAssert({-> assert_equal([
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 \ {'lnum': 9, 'id': 12, 'name': 'debugPC', 'priority': 110,
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 \ 'group': 'TermDebug'},
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 \ 'priority': 110, 'group': 'TermDebug'}],
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
72 \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 Finish
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 call term_wait(gdb_buf)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 redraw!
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
76 call WaitForAssert({-> assert_equal([
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 \ 'priority': 110, 'group': 'TermDebug'},
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 \ {'lnum': 20, 'id': 12, 'name': 'debugPC',
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 \ 'priority': 110, 'group': 'TermDebug'}],
33041
5334aca4cef4 patch 9.0.1811: still some issues with term_debug test
Christian Brabandt <cb@256bit.org>
parents: 33037
diff changeset
81 \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 Continue
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 wincmd t
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 quit!
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 redraw!
33734
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
86 call WaitForAssert({-> assert_equal(1, winnr('$'))})
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 call assert_equal([], sign_getplaced('', #{group: 'TermDebug'})[0].signs)
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 call delete('XTD_basic')
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 %bw!
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 endfunc
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92
33734
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
93 func Test_termdebug_mapping()
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
94 %bw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
95 call assert_equal(maparg('K', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
96 call assert_equal(maparg('-', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
97 call assert_equal(maparg('+', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
98 Termdebug
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
99 call WaitForAssert({-> assert_equal(3, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
100 wincmd b
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
101 call assert_equal(maparg('K', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
102 call assert_equal(maparg('-', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
103 call assert_equal(maparg('+', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
104 call assert_equal(maparg('K', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
105 call assert_equal(maparg('-', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
106 call assert_equal(maparg('+', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
107 call assert_equal(maparg('K', 'n', 0, 1).rhs, ':Evaluate<CR>')
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
108 wincmd t
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
109 quit!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
110 redraw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
111 call WaitForAssert({-> assert_equal(1, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
112 call assert_equal(maparg('K', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
113 call assert_equal(maparg('-', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
114 call assert_equal(maparg('+', 'n', 0, 1)->empty(), 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
115
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
116 %bw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
117 nnoremap K :echom "K"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
118 nnoremap - :echom "-"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
119 nnoremap + :echom "+"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
120 Termdebug
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
121 call WaitForAssert({-> assert_equal(3, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
122 wincmd b
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
123 call assert_equal(maparg('K', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
124 call assert_equal(maparg('-', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
125 call assert_equal(maparg('+', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
126 call assert_equal(maparg('K', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
127 call assert_equal(maparg('-', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
128 call assert_equal(maparg('+', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
129 call assert_equal(maparg('K', 'n', 0, 1).rhs, ':Evaluate<CR>')
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
130 wincmd t
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
131 quit!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
132 redraw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
133 call WaitForAssert({-> assert_equal(1, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
134 call assert_equal(maparg('K', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
135 call assert_equal(maparg('-', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
136 call assert_equal(maparg('+', 'n', 0, 1)->empty(), 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
137 call assert_equal(maparg('K', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
138 call assert_equal(maparg('-', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
139 call assert_equal(maparg('+', 'n', 0, 1).buffer, 0)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
140 call assert_equal(maparg('K', 'n', 0, 1).rhs, ':echom "K"<cr>')
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
141
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
142 %bw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
143 nnoremap <buffer> K :echom "bK"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
144 nnoremap <buffer> - :echom "b-"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
145 nnoremap <buffer> + :echom "b+"<cr>
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
146 Termdebug
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
147 call WaitForAssert({-> assert_equal(3, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
148 wincmd b
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
149 call assert_equal(maparg('K', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
150 call assert_equal(maparg('-', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
151 call assert_equal(maparg('+', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
152 call assert_equal(maparg('K', 'n', 0, 1).rhs, ':echom "bK"<cr>')
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
153 wincmd t
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
154 quit!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
155 redraw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
156 call WaitForAssert({-> assert_equal(1, winnr('$'))})
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
157 call assert_equal(maparg('K', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
158 call assert_equal(maparg('-', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
159 call assert_equal(maparg('+', 'n', 0, 1).buffer, 1)
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
160 call assert_equal(maparg('K', 'n', 0, 1).rhs, ':echom "bK"<cr>')
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
161
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
162 %bw!
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
163 endfunc
55e587f6b02f runtime(termdebug): handle buffer-local mappings properly
Christian Brabandt <cb@256bit.org>
parents: 33041
diff changeset
164
32998
d55bf5bbcb6f patch 9.0.1791: No tests for the termdebug plugin
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165 " vim: shiftwidth=2 sts=2 expandtab