Mercurial > vim
comparison src/testdir/test_textprop.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 | 7d0025a2940a |
children | 96d6d31dd66b |
comparison
equal
deleted
inserted
replaced
31848:b83cac410fcf | 31849:dbec60b8c253 |
---|---|
2743 func Test_prop_with_text_below_after_empty() | 2743 func Test_prop_with_text_below_after_empty() |
2744 CheckRunVimInTerminal | 2744 CheckRunVimInTerminal |
2745 | 2745 |
2746 let lines =<< trim END | 2746 let lines =<< trim END |
2747 vim9script | 2747 vim9script |
2748 | 2748 |
2749 setline(1, ['vim9script', '', 'three', '']) | 2749 setline(1, ['vim9script', '', 'three', '']) |
2750 | 2750 |
2751 # Add text prop below empty line 2 with padding. | 2751 # Add text prop below empty line 2 with padding. |
2752 prop_type_add('test', {highlight: 'ErrorMsg'}) | 2752 prop_type_add('test', {highlight: 'ErrorMsg'}) |
2753 prop_add(2, 0, { | 2753 prop_add(2, 0, { |
2766 text_padding_left: 0, | 2766 text_padding_left: 0, |
2767 }) | 2767 }) |
2768 END | 2768 END |
2769 call writefile(lines, 'XscriptPropBelowAfterEmpty', 'D') | 2769 call writefile(lines, 'XscriptPropBelowAfterEmpty', 'D') |
2770 let buf = RunVimInTerminal('-S XscriptPropBelowAfterEmpty', #{rows: 8, cols: 60}) | 2770 let buf = RunVimInTerminal('-S XscriptPropBelowAfterEmpty', #{rows: 8, cols: 60}) |
2771 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_1', {}) | 2771 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_1', {}) |
2772 | 2772 |
2773 call term_sendkeys(buf, ":set number\<CR>") | 2773 call term_sendkeys(buf, ":set number\<CR>") |
2774 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_2', {}) | 2774 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_2', {}) |
2775 | 2775 |
2776 call term_sendkeys(buf, ":set nowrap\<CR>") | 2776 call term_sendkeys(buf, ":set nowrap\<CR>") |
2777 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_3', {}) | 2777 call VerifyScreenDump(buf, 'Test_prop_below_after_empty_3', {}) |
2778 | 2778 |
2779 call StopVimInTerminal(buf) | 2779 call StopVimInTerminal(buf) |
2780 endfunc | 2780 endfunc |
2781 | 2781 |
2782 func Test_prop_with_text_below_after_match() | 2782 func Test_prop_with_text_below_after_match() |
3308 prop_add(1, 6, {type: 'propincl', text: 'after '}) | 3308 prop_add(1, 6, {type: 'propincl', text: 'after '}) |
3309 cursor(1, 6) | 3309 cursor(1, 6) |
3310 prop_type_add('propnotincl', {highlight: 'NonText', start_incl: false}) | 3310 prop_type_add('propnotincl', {highlight: 'NonText', start_incl: false}) |
3311 prop_add(1, 15, {type: 'propnotincl', text: 'before '}) | 3311 prop_add(1, 15, {type: 'propnotincl', text: 'before '}) |
3312 | 3312 |
3313 set cindent sw=4 | 3313 set cindent sw=4 |
3314 prop_type_add('argname', {highlight: 'DiffChange', start_incl: true}) | 3314 prop_type_add('argname', {highlight: 'DiffChange', start_incl: true}) |
3315 prop_add(3, 10, {type: 'argname', text: 'arg: '}) | 3315 prop_add(3, 10, {type: 'argname', text: 'arg: '}) |
3316 END | 3316 END |
3317 call writefile(lines, 'XscriptPropsStartIncl', 'D') | 3317 call writefile(lines, 'XscriptPropsStartIncl', 'D') |
3318 let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60}) | 3318 let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60}) |
3749 call term_sendkeys(buf, ":windo set number\<CR>") | 3749 call term_sendkeys(buf, ":windo set number\<CR>") |
3750 call VerifyScreenDump(buf, 'Test_prop_diff_mode_2', {}) | 3750 call VerifyScreenDump(buf, 'Test_prop_diff_mode_2', {}) |
3751 | 3751 |
3752 call StopVimInTerminal(buf) | 3752 call StopVimInTerminal(buf) |
3753 endfunc | 3753 endfunc |
3754 | 3754 |
3755 func Test_error_when_using_negative_id() | 3755 func Test_error_when_using_negative_id() |
3756 call prop_type_add('test1', #{highlight: 'ErrorMsg'}) | 3756 call prop_type_add('test1', #{highlight: 'ErrorMsg'}) |
3757 call prop_add(1, 1, #{type: 'test1', text: 'virtual'}) | 3757 call prop_add(1, 1, #{type: 'test1', text: 'virtual'}) |
3758 call assert_fails("call prop_add(1, 1, #{type: 'test1', length: 1, id: -1})", 'E1293:') | 3758 call assert_fails("call prop_add(1, 1, #{type: 'test1', length: 1, id: -1})", 'E1293:') |
3759 | 3759 |