annotate src/testdir/color_ramp.vim @ 32697:e5cd5e8627da v9.0.1679

patch 9.0.1679: Cleanup Tests from leftover files Commit: https://github.com/vim/vim/commit/84bc00e9b52b1174888f2f696f8b628a83c49988 Author: Christian Brabandt <cb@256bit.org> Date: Thu Jul 13 11:45:54 2023 +0200 patch 9.0.1679: Cleanup Tests from leftover files Problem: Tests may leave leftover files around Solution: Clean up tests and remove files There were a few failures in 'linux (huge, gcc, testgui, true, true)' e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156 ,---- | Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting: | line 70: | E445: Other window contains changes | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted `---- Which is puzzling, because the Xtest_stable_xxd file should have been long gone after test_crypt.vim is run (and definitely no longer be staying around in test_quickfix.vim). So try to clean up properly after a test script is run, just in case any X<file> is still around. During testing, a found a few leftover files, which I also fixed in the relevant test-file. Unfortunately, the test workflow 'linux (huge, gcc, testgui, true, true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in test_crypt.vim. Hopefully this is only temporary.
author Christian Brabandt <cb@256bit.org>
date Tue, 08 Aug 2023 20:45:05 +0200
parents 89364104be93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Script to generate a file that shows al 256 xterm colors
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 new
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
4 let lnum = 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
5
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
6 " | in original color pair to see white background.
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
7 let trail_bar = "\033[m|"
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 " ANSI colors
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
10 call setline(lnum, 'ANSI background')
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
11 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
12
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s = ''
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 for nr in range(0, 7)
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 let s .= "\033[4" . nr . "m "
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfor
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 for nr in range(8, 15)
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 let s .= "\033[10" . (nr - 8) . "m "
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 endfor
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
20 let s .= trail_bar
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
21
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
22 call setline(lnum, s)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
23 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
24
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
25 " ANSI text colors
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
26 call setline(lnum, 'ANSI text')
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
27 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
28
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
29 let s = ''
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
30 for nr in range(0, 7)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
31 let s .= "\033[0;3" . nr . "mxxxx"
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
32 endfor
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
33 for nr in range(8, 15)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
34 let s .= "\033[0;9" . (nr - 8) . "mxxxx"
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
35 endfor
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
36 let s .= trail_bar
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
37
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
38 call setline(lnum, s)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
39 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
40
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
41 " ANSI with bold text
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
42 call setline(lnum, 'ANSI bold text')
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
43 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
44
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
45 let s = ''
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
46 for nr in range(0, 7)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
47 let s .= "\033[1;3" . nr . "mxxxx"
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
48 endfor
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
49 for nr in range(8, 15)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
50 let s .= "\033[1;9" . (nr - 8) . "mxxxx"
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
51 endfor
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
52 let s .= trail_bar
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
53
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
54 call setline(lnum, s)
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
55 let lnum += 1
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 " 6 x 6 x 6 color cube
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
58 call setline(lnum, 'color cube')
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
59 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
60
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 for high in range(0, 5)
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 let s = ''
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 for low in range(0, 35)
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 let nr = low + high * 36
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 let s .= "\033[48;5;" . (nr + 16) . "m "
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 endfor
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
67 let s .= trail_bar
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
68 call setline(lnum + high, s)
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 endfor
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
70 let lnum += 6
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 " 24 shades of grey
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
73 call setline(lnum, 'grey ramp')
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
74 let lnum += 1
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
75
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 let s = ''
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 for nr in range(0, 23)
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 let s .= "\033[48;5;" . (nr + 232) . "m "
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 endfor
20053
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
80 let s .= trail_bar
89364104be93 patch 8.2.0582: color ramp test does not show text colors
Bram Moolenaar <Bram@vim.org>
parents: 12944
diff changeset
81 call setline(lnum, s)
12944
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 set binary
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 write! <sfile>:h/color_ramp.txt
2d54f1e7ba0f patch 8.0.1348: make testclean deletes script file on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 quit