Mercurial > vim
comparison src/testdir/test_indent.vim @ 31849:dbec60b8c253 v9.0.1257
patch 9.0.1257: code style is not check in test scripts
Commit: https://github.com/vim/vim/commit/94722c510745a0cfd494c51625a514b92dd2bfb2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 28 19:19:03 2023 +0000
patch 9.0.1257: code style is not check in test scripts
Problem: Code style is not check in test scripts.
Solution: Add basic code style check for test files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 28 Jan 2023 20:30:04 +0100 |
parents | f08ed0738f7a |
children | 872c07d5befe |
comparison
equal
deleted
inserted
replaced
31848:b83cac410fcf | 31849:dbec60b8c253 |
---|---|
173 let &modeline = modeline | 173 let &modeline = modeline |
174 close! | 174 close! |
175 endfunc | 175 endfunc |
176 | 176 |
177 func Test_indent_func_with_gq() | 177 func Test_indent_func_with_gq() |
178 | 178 |
179 function GetTeXIndent() | 179 function GetTeXIndent() |
180 " Sample indent expression for TeX files | 180 " Sample indent expression for TeX files |
181 let lnum = prevnonblank(v:lnum - 1) | 181 let lnum = prevnonblank(v:lnum - 1) |
182 " At the start of the file use zero indent. | 182 " At the start of the file use zero indent. |
183 if lnum == 0 | 183 if lnum == 0 |
184 return 0 | 184 return 0 |
185 endif | 185 endif |
186 let line = getline(lnum) | 186 let line = getline(lnum) |
187 let ind = indent(lnum) | 187 let ind = indent(lnum) |
188 " Add a 'shiftwidth' after beginning of environments. | 188 " Add a 'shiftwidth' after beginning of environments. |
189 if line =~ '\\begin{center}' | 189 if line =~ '\\begin{center}' |
190 let ind = ind + shiftwidth() | 190 let ind = ind + shiftwidth() |
191 endif | 191 endif |
192 return ind | 192 return ind |
193 endfunction | 193 endfunction |
194 | 194 |
246 \ ' ultrices posuere cubilia curae;', '', ''] | 246 \ ' ultrices posuere cubilia curae;', '', ''] |
247 call assert_equal(expected, getline(1, '$')) | 247 call assert_equal(expected, getline(1, '$')) |
248 | 248 |
249 bwipe! | 249 bwipe! |
250 delmark ab | 250 delmark ab |
251 delfunction GetTeXIndent | 251 delfunction GetTeXIndent |
252 endfu | 252 endfu |
253 | 253 |
254 func Test_formatting_keeps_first_line_indent() | 254 func Test_formatting_keeps_first_line_indent() |
255 let lines =<< trim END | 255 let lines =<< trim END |
256 foo() | 256 foo() |