comparison src/testdir/screendump.vim @ 16249:67e43b01497f v8.1.1129

patch 8.1.1129: when making a new screendump test have to create the file commit https://github.com/vim/vim/commit/2d7260d66575052124b76c8b97b957319111bfef Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 6 20:51:52 2019 +0200 patch 8.1.1129: when making a new screendump test have to create the file Problem: When making a new screendump test have to create the file. Solution: Continue creating the failed screendump, so it can be moved once it is correct.
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Apr 2019 21:00:05 +0200
parents b23048205589
children 606a49386aa1
comparison
equal deleted inserted replaced
16248:498933e34fec 16249:67e43b01497f
116 " leave some time for updating the original window 116 " leave some time for updating the original window
117 sleep 10m 117 sleep 10m
118 call delete(testfile) 118 call delete(testfile)
119 call term_dumpwrite(a:buf, testfile, a:options) 119 call term_dumpwrite(a:buf, testfile, a:options)
120 let testdump = readfile(testfile) 120 let testdump = readfile(testfile)
121 let refdump = readfile(reference) 121 if filereadable(reference)
122 let refdump = readfile(reference)
123 else
124 " Must be a new screendump, always fail
125 let refdump = []
126 endif
122 if refdump == testdump 127 if refdump == testdump
123 call delete(testfile) 128 call delete(testfile)
124 if did_mkdir 129 if did_mkdir
125 call delete('failed', 'd') 130 call delete('failed', 'd')
126 endif 131 endif
127 break 132 break
128 endif 133 endif
129 if i == 100 134 if i == 100
130 " Leave the test file around for inspection. 135 " Leave the failed dump around for inspection.
131 let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")' 136 if filereadable(reference)
132 if a:0 == 1 137 let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")'
133 let msg = a:1 . ': ' . msg 138 if a:0 == 1
134 endif 139 let msg = a:1 . ': ' . msg
135 if len(testdump) != len(refdump) 140 endif
136 let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump) 141 if len(testdump) != len(refdump)
142 let msg = msg . '; line count is ' . len(testdump) . ' instead of ' . len(refdump)
143 endif
144 else
145 let msg = 'See new dump file: call term_dumpload("' . testfile . '")'
137 endif 146 endif
138 for i in range(len(refdump)) 147 for i in range(len(refdump))
139 if i >= len(testdump) 148 if i >= len(testdump)
140 break 149 break
141 endif 150 endif