summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1047
blob: aaa191b9abc2d89ce0318f646664f7214e55ffb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
To: vim_dev@googlegroups.com
Subject: Patch 8.1.10
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1047
Problem:    WINCH signal is not tested.
Solution:   Add a test. (Dominique Pelle, closes #4158)
Files:	    src/testdir/Make_all.mak, src/testdir/test_signals.vim


*** ../vim-8.1.1046/src/testdir/Make_all.mak	2019-03-14 13:42:57.169435481 +0100
--- src/testdir/Make_all.mak	2019-03-24 14:54:25.343711086 +0100
***************
*** 224,229 ****
--- 224,230 ----
  	test_searchpos \
  	test_set \
  	test_sha256 \
+ 	test_signals \
  	test_signs \
  	test_smartindent \
  	test_sort \
***************
*** 385,390 ****
--- 386,392 ----
  	test_scrollbind.res \
  	test_search.res \
  	test_shortpathname.res \
+ 	test_signals.res \
  	test_signs.res \
  	test_smartindent.res \
  	test_source.res \
*** ../vim-8.1.1046/src/testdir/test_signals.vim	2019-03-24 14:57:43.686391002 +0100
--- src/testdir/test_signals.vim	2019-03-24 14:53:51.031939485 +0100
***************
*** 0 ****
--- 1,44 ----
+ " Test signal handling.
+ 
+ if !has('unix')
+   finish
+ endif
+ 
+ source shared.vim
+ 
+ " Test signal WINCH (window resize signal)
+ func Test_signal_WINCH()
+   let signals = system('kill -l')
+   if signals !~ '\<WINCH\>'
+     " signal WINCH is not available, skip the test.
+     return
+   endif
+ 
+   " We do not actually want to change the size of the terminal.
+   let old_WS = ''
+   if exists('&t_WS')
+     let old_WS = &t_WS
+     let &t_WS = ''
+   endif
+ 
+   let old_lines = &lines
+   let old_columns = &columns
+   let new_lines = &lines - 2
+   let new_columns = &columns - 2
+ 
+   exe 'set lines=' . new_lines
+   exe 'set columns=' . new_columns
+   call assert_equal(new_lines, &lines)
+   call assert_equal(new_columns, &columns)
+ 
+   " Send signal and wait for signal to be processed.
+   " 'lines' and 'columns' should have been restored
+   " after handing signal WINCH.
+   exe 'silent !kill -s WINCH ' . getpid()
+   call WaitForAssert({-> assert_equal(old_lines, &lines)})
+   call assert_equal(old_columns, &columns)
+ 
+   if old_WS != ''
+     let &t_WS = old_WS
+   endif
+ endfunc
*** ../vim-8.1.1046/src/version.c	2019-03-24 14:02:00.981468747 +0100
--- src/version.c	2019-03-24 14:30:13.869404055 +0100
***************
*** 777,778 ****
--- 777,780 ----
  {   /* Add new patch number below this line */
+ /**/
+     1047,
  /**/

-- 
Corduroy pillows: They're making headlines!

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///