blob: 445fe8d5a725a131207c04c94acf60a1ecc0f97c [file] [log] [blame]
Christian Brabandte1dc9a62023-09-02 14:40:13 +02001" Some tests, that used to crash Vim
2source check.vim
3source screendump.vim
4
5CheckScreendump
6
7func Test_crash1()
8 " The following used to crash Vim
Christian Brabandtced2c732023-09-02 21:15:52 +02009 let opts = #{wait_for_ruler: 0, rows: 20}
Christian Brabandte1dc9a62023-09-02 14:40:13 +020010 let args = ' -u NONE -i NONE -n -e -s -S '
11 let buf = RunVimInTerminal(args .. ' crash/poc_huaf1', opts)
12 call VerifyScreenDump(buf, 'Test_crash_01', {})
13 exe buf .. "bw!"
14
15 let buf = RunVimInTerminal(args .. ' crash/poc_huaf2', opts)
16 call VerifyScreenDump(buf, 'Test_crash_01', {})
17 exe buf .. "bw!"
18
19 let buf = RunVimInTerminal(args .. ' crash/poc_huaf3', opts)
20 call VerifyScreenDump(buf, 'Test_crash_01', {})
21 exe buf .. "bw!"
22
23endfunc
24
Christian Brabandtced2c732023-09-02 21:15:52 +020025func Test_crash2()
26 " The following used to crash Vim
27 let opts = #{wait_for_ruler: 0, rows: 20}
28 let args = ' -u NONE -i NONE -n -e -s -S '
29 let buf = RunVimInTerminal(args .. ' crash/vim_regsub_both', opts)
30 call VerifyScreenDump(buf, 'Test_crash_01', {})
31 exe buf .. "bw!"
32endfunc
33
Christian Brabandte1dc9a62023-09-02 14:40:13 +020034" vim: shiftwidth=2 sts=2 expandtab