diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-21 21:30:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-21 21:30:50 +0100 |
commit | 7e569d09d2ec4fa334a2d3d5b0b6dbca16d97133 (patch) | |
tree | 28d255b68e20dde43c786e46de9b2963554d494e /src/testdir/test_cindent.vim | |
parent | 8e145b82464a21ee4fdf7948f04e2a1d505f8bfa (diff) |
patch 8.2.4994: tests are using legacy functionsv8.2.4994
Problem: Tests are using legacy functions.
Solution: Convert a few tests to use :def functions.
Diffstat (limited to 'src/testdir/test_cindent.vim')
-rw-r--r-- | src/testdir/test_cindent.vim | 1023 |
1 files changed, 519 insertions, 504 deletions
diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim index c65a0dab33..96e99ac71c 100644 --- a/src/testdir/test_cindent.vim +++ b/src/testdir/test_cindent.vim @@ -1,22 +1,22 @@ " Test for cinoptions and cindent -func Test_cino_hash() - " Test that curbuf->b_ind_hash_comment is correctly reset +def Test_cino_hash() + # Test that curbuf->b_ind_hash_comment is correctly reset new setlocal cindent cinoptions=#1 setlocal cinoptions= - call setline(1, ["#include <iostream>"]) - call cursor(1, 1) + setline(1, ["#include <iostream>"]) + cursor(1, 1) norm! o#include - "call feedkeys("o#include\<esc>", 't') - call assert_equal(["#include <iostream>", "#include"], getline(1,2)) + assert_equal(["#include <iostream>", "#include"], getline(1, 2)) + bwipe! -endfunc +enddef -func Test_cino_extern_c() - " Test for cino-E +def Test_cino_extern_c() + # Test for cino-E - let without_ind =<< trim [CODE] + var without_ind =<< trim [CODE] #ifdef __cplusplus extern "C" { #endif @@ -26,7 +26,7 @@ func Test_cino_extern_c() #endif [CODE] - let with_ind =<< trim [CODE] + var with_ind =<< trim [CODE] #ifdef __cplusplus extern "C" { #endif @@ -37,17 +37,17 @@ func Test_cino_extern_c() [CODE] new setlocal cindent cinoptions=E0 - call setline(1, without_ind) - call feedkeys("gg=G", 'tx') - call assert_equal(with_ind, getline(1, '$')) + setline(1, without_ind) + feedkeys("gg=G", 'tx') + assert_equal(with_ind, getline(1, '$')) setlocal cinoptions=E-s - call setline(1, with_ind) - call feedkeys("gg=G", 'tx') - call assert_equal(without_ind, getline(1, '$')) + setline(1, with_ind) + feedkeys("gg=G", 'tx') + assert_equal(without_ind, getline(1, '$')) setlocal cinoptions=Es - let tests = [ + var tests = [ \ ['recognized', ['extern "C" {'], "\t\t;"], \ ['recognized', ['extern "C++" {'], "\t\t;"], \ ['recognized', ['extern /* com */ "C"{'], "\t\t;"], @@ -60,78 +60,84 @@ func Test_cino_extern_c() \ ] for pair in tests - let lines = pair[1] - call setline(1, lines) - call feedkeys(len(lines) . "Go;", 'tx') - call assert_equal(pair[2], getline(len(lines) + 1), 'Failed for "' . string(lines) . '"') + var lines = pair[1] + setline(1, lines) + feedkeys(len(lines) .. "Go;", 'tx') + assert_equal(pair[2], getline(len(lines) + 1), + 'Failed for "' .. string(lines) .. '"') endfor bwipe! -endfunc +enddef -func Test_cindent_rawstring() +def Test_cindent_rawstring() new setl cindent - call feedkeys("i" . - \ "int main() {\<CR>" . - \ "R\"(\<CR>" . - \ ")\";\<CR>" . + feedkeys("i" .. + \ "int main() {\<CR>" .. + \ "R\"(\<CR>" .. + \ ")\";\<CR>" .. \ "statement;\<Esc>", "x") - call assert_equal("\tstatement;", getline(line('.'))) - bw! -endfunc + assert_equal("\tstatement;", getline(line('.'))) + + bwipe! +enddef -func Test_cindent_expr() +def Test_cindent_expr() new - func! MyIndentFunction() + def g:MyIndentFunction(): number return v:lnum == 1 ? shiftwidth() : 0 - endfunc - setl expandtab sw=8 indentkeys+=; indentexpr=MyIndentFunction() - let testinput =<< trim [CODE] + enddef + setl expandtab sw=8 indentkeys+=; indentexpr=g:MyIndentFunction() + var testinput =<< trim [CODE] var_a = something() b = something() [CODE] - call setline(1, testinput) - call cursor(1, 1) - call feedkeys("^\<c-v>j$A;\<esc>", 'tnix') - let expected =<< [CODE] + setline(1, testinput) + cursor(1, 1) + feedkeys("^\<c-v>j$A;\<esc>", 'tnix') + var expected =<< [CODE] var_a = something(); b = something(); [CODE] - call assert_equal(expected, getline(1, '$')) + assert_equal(expected, getline(1, '$')) - %d - let testinput =<< [CODE] + :%d + testinput =<< [CODE] var_a = something() b = something() [CODE] - call setline(1, testinput) - call cursor(1, 1) - call feedkeys("^\<c-v>j$A;\<esc>", 'tnix') - let expected =<< [CODE] + setline(1, testinput) + cursor(1, 1) + feedkeys("^\<c-v>j$A;\<esc>", 'tnix') + expected =<< [CODE] var_a = something(); b = something() [CODE] - call assert_equal(expected, getline(1, '$')) - bw! -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_func() + delfunc g:MyIndentFunction + + bwipe! +enddef + +def Test_cindent_func() new setlocal cindent - call setline(1, ['int main(void)', '{', 'return 0;', '}']) - call assert_equal(-1, cindent(0)) - call assert_equal(&sw, 3->cindent()) - call assert_equal(-1, cindent(line('$')+1)) + setline(1, ['int main(void)', '{', 'return 0;', '}']) + assert_equal(-1, cindent(0)) + assert_equal(&sw, 3->cindent()) + assert_equal(-1, cindent(line('$') + 1)) + bwipe! -endfunc +enddef -func Test_cindent_1() +def Test_cindent_1() new setl cindent ts=4 sw=4 setl cino& sts& - let code =<< trim [CODE] + var code =<< trim [CODE] /* start of AUTO matically checked vim: set ts=4 : */ { if (test) @@ -1103,12 +1109,12 @@ func Test_cindent_1() /* end of AUTO */ [CODE] - call append(0, code) + append(0, code) normal gg - call search('start of AUTO') + search('start of AUTO') exe "normal =/end of AUTO\<CR>" - let expected =<< trim [CODE] + var expected =<< trim [CODE] /* start of AUTO matically checked vim: set ts=4 : */ { if (test) @@ -2081,17 +2087,18 @@ func Test_cindent_1() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) + + bwipe! +enddef -func Test_cindent_2() +def Test_cindent_2() new setl cindent ts=4 sw=4 setl tw=0 noai fo=croq - let &wm = &columns - 20 + &wm = &columns - 20 - let code =<< trim [CODE] + var code =<< trim [CODE] { /* this is @@ -2102,12 +2109,12 @@ func Test_cindent_2() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('serious', 'e') + search('serious', 'e') normal a about life, the universe, and the rest - let expected =<< trim [CODE] + var expected =<< trim [CODE] { /* this is @@ -2122,16 +2129,17 @@ func Test_cindent_2() [CODE] - call assert_equal(expected, getline(1, '$')) + assert_equal(expected, getline(1, '$')) set wm& - enew! | close -endfunc -func Test_cindent_3() + bwipe! +enddef + +def Test_cindent_3() new setl nocindent ts=4 sw=4 - let code =<< trim [CODE] + var code =<< trim [CODE] { /* * Testing for comments, without 'cin' set @@ -2149,18 +2157,18 @@ func Test_cindent_3() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('comments') + search('comments') normal joabout life - call search('happens') + search('happens') normal jothere - call search('below') + search('below') normal oline - call search('this') + search('this') normal Ohello - let expected =<< trim [CODE] + var expected =<< trim [CODE] { /* * Testing for comments, without 'cin' set @@ -2183,15 +2191,16 @@ func Test_cindent_3() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) + + bwipe! +enddef -func Test_cindent_4() +def Test_cindent_4() new setl cindent ts=4 sw=4 - let code =<< trim [CODE] + var code =<< trim [CODE] { var = this + that + vec[0] * vec[0] + vec[1] * vec[1] @@ -2199,12 +2208,12 @@ func Test_cindent_4() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('vec2') + search('vec2') normal == - let expected =<< trim [CODE] + var expected =<< trim [CODE] { var = this + that + vec[0] * vec[0] + vec[1] * vec[1] @@ -2213,16 +2222,17 @@ func Test_cindent_4() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_5() + bwipe! +enddef + +def Test_cindent_5() new setl cindent ts=4 sw=4 setl cino=}4 - let code =<< trim [CODE] + var code =<< trim [CODE] { asdf asdflkajds f; if (tes & ting) { @@ -2239,13 +2249,13 @@ func Test_cindent_5() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('testing1') + search('testing1') exe "normal k2==/testing2\<CR>" normal k2== - let expected =<< trim [CODE] + var expected =<< trim [CODE] { asdf asdflkajds f; if (tes & ting) { @@ -2263,16 +2273,17 @@ func Test_cindent_5() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_6() + bwipe! +enddef + +def Test_cindent_6() new setl cindent ts=4 sw=4 setl cino=(0,)20 - let code =<< trim [CODE] + var code =<< trim [CODE] main ( int first_par, /* * Comment for * first par @@ -2296,12 +2307,12 @@ func Test_cindent_6() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('main') + search('main') normal =][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] main ( int first_par, /* * Comment for * first par @@ -2326,16 +2337,17 @@ func Test_cindent_6() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_7() + bwipe! +enddef + +def Test_cindent_7() new setl cindent ts=4 sw=4 setl cino=es,n0s - let code =<< trim [CODE] + var code =<< trim [CODE] main(void) { /* Make sure that cino=X0s is not parsed like cino=Xs. */ @@ -2348,12 +2360,12 @@ func Test_cindent_7() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('main') + search('main') normal =][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] main(void) { /* Make sure that cino=X0s is not parsed like cino=Xs. */ @@ -2366,17 +2378,17 @@ func Test_cindent_7() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_8() +def Test_cindent_8() new setl cindent ts=4 sw=4 setl cino= - let code =<< trim [CODE] + var code =<< trim [CODE] { do @@ -2393,11 +2405,11 @@ func Test_cindent_8() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] { do @@ -2415,15 +2427,16 @@ func Test_cindent_8() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_9() + bwipe! +enddef + +def Test_cindent_9() new setl cindent ts=4 sw=4 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { @@ -2438,11 +2451,11 @@ func Test_cindent_9() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { @@ -2458,16 +2471,17 @@ func Test_cindent_9() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) + + bwipe! +enddef -func Test_cindent_10() +def Test_cindent_10() new setl cindent ts=4 sw=4 setl cino={s,e-s - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { @@ -2481,11 +2495,11 @@ func Test_cindent_10() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { @@ -2500,16 +2514,17 @@ func Test_cindent_10() [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + assert_equal(expected, getline(1, '$')) -func Test_cindent_11() + bwipe! +enddef + +def Test_cindent_11() new setl cindent ts=4 sw=4 setl cino={s,fs - let code =<< trim [CODE] + var code =<< trim [CODE] void bar(void) { static array[2][2] = @@ -2544,11 +2559,11 @@ func Test_cindent_11() /* foo */ [CODE] - call append(0, code) + append(0, code) normal gg exe "normal ]]=/ foo\<CR>" - let expected =<< trim [CODE] + var expected =<< trim [CODE] void bar(void) { static array[2][2] = @@ -2583,17 +2598,17 @@ func Test_cindent_11() /* foo */ [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_12() +def Test_cindent_12() new setl cindent ts=4 sw=4 setl cino= - let code =<< trim [CODE] + var code =<< trim [CODE] a() { do { @@ -2605,12 +2620,12 @@ func Test_cindent_12() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('while') + search('while') normal ohere - let expected =<< trim [CODE] + var expected =<< trim [CODE] a() { do { @@ -2623,17 +2638,17 @@ func Test_cindent_12() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_13() +def Test_cindent_13() new setl cindent ts=4 sw=4 setl cino= com= - let code =<< trim [CODE] + var code =<< trim [CODE] a() { label1: @@ -2642,13 +2657,13 @@ func Test_cindent_13() } [CODE] - call append(0, code) + append(0, code) normal gg - call search('comment') - exe "normal olabel2: b();\rlabel3 /* post */:\r/* pre */ label4:\r" . - \ "f(/*com*/);\rif (/*com*/)\rcmd();" + search('comment') + exe "normal olabel2: b();\rlabel3 /* post */:\r/* pre */ label4:\r" + .. "f(/*com*/);\rif (/*com*/)\rcmd();" - let expected =<< trim [CODE] + var expected =<< trim [CODE] a() { label1: @@ -2663,17 +2678,17 @@ func Test_cindent_13() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_14() +def Test_cindent_14() new setl cindent ts=4 sw=4 setl comments& comments^=s:/*,m:**,ex:*/ - let code =<< trim [CODE] + var code =<< trim [CODE] /* * A simple comment */ @@ -2683,12 +2698,12 @@ func Test_cindent_14() */ [CODE] - call append(0, code) + append(0, code) normal gg - call search('simple') + search('simple') normal =5j - let expected =<< trim [CODE] + var expected =<< trim [CODE] /* * A simple comment */ @@ -2698,18 +2713,18 @@ func Test_cindent_14() */ [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_15() +def Test_cindent_15() new setl cindent ts=4 sw=4 setl cino=c0 setl comments& comments-=s1:/* comments^=s0:/* - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { @@ -2719,11 +2734,11 @@ func Test_cindent_15() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { @@ -2733,18 +2748,18 @@ func Test_cindent_15() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_16() +def Test_cindent_16() new setl cindent ts=4 sw=4 setl cino=c0,C1 setl comments& comments-=s1:/* comments^=s0:/* - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { @@ -2754,11 +2769,11 @@ func Test_cindent_16() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { @@ -2768,17 +2783,17 @@ func Test_cindent_16() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_17() +def Test_cindent_17() new setl cindent ts=4 sw=4 setl cino= - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { c = c1 && @@ -2789,11 +2804,11 @@ func Test_cindent_17() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { c = c1 && @@ -2804,17 +2819,17 @@ func Test_cindent_17() } [CODE] - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc -func Test_cindent_18() + bwipe! +enddef + +def Test_cindent_18() new setl cindent ts=4 sw=4 setl cino=(s - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { c = c1 && @@ -2825,11 +2840,11 @@ func Test_cindent_18() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { c = c1 && @@ -2840,17 +2855,17 @@ func Test_cindent_18() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_19() +def Test_cindent_19() new setl cindent ts=4 sw=4 set cino=(s,U1 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { c = c1 && @@ -2861,11 +2876,11 @@ func Test_cindent_19() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { c = c1 && @@ -2876,17 +2891,17 @@ func Test_cindent_19() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_20() +def Test_cindent_20() new setl cindent ts=4 sw=4 setl cino=(0 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { if ( c1 @@ -2896,11 +2911,11 @@ func Test_cindent_20() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { if ( c1 @@ -2910,17 +2925,17 @@ func Test_cindent_20() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_21() +def Test_cindent_21() new setl cindent ts=4 sw=4 setl cino=(0,w1 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { if ( c1 @@ -2930,11 +2945,11 @@ func Test_cindent_21() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { if ( c1 @@ -2944,17 +2959,17 @@ func Test_cindent_21() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_22() +def Test_cindent_22() new setl cindent ts=4 sw=4 setl cino=(s - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { c = c1 && ( @@ -2968,11 +2983,11 @@ func Test_cindent_22() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { c = c1 && ( @@ -2986,17 +3001,17 @@ func Test_cindent_22() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_23() +def Test_cindent_23() new setl cindent ts=4 sw=4 setl cino=(s,m1 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { c = c1 && ( @@ -3010,11 +3025,11 @@ func Test_cindent_23() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { c = c1 && ( @@ -3028,17 +3043,17 @@ func Test_cindent_23() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_24() +def Test_cindent_24() new setl cindent ts=4 sw=4 setl cino=b1 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { switch (x) @@ -3053,11 +3068,11 @@ func Test_cindent_24() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { switch (x) @@ -3072,17 +3087,17 @@ func Test_cindent_24() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_25() +def Test_cindent_25() new setl cindent ts=4 sw=4 setl cino=(0,W5 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { invokeme( @@ -3098,11 +3113,11 @@ func Test_cindent_25() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { invokeme( @@ -3118,17 +3133,17 @@ func Test_cindent_25() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_26() +def Test_cindent_26() new setl cindent ts=4 sw=4 setl cino=/6 - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { statement; @@ -3137,11 +3152,11 @@ func Test_cindent_26() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { statement; @@ -3150,17 +3165,17 @@ func Test_cindent_26() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_27() +def Test_cindent_27() new setl cindent ts=4 sw=4 setl cino= - let code =<< trim [CODE] + var code =<< trim [CODE] void f() { statement; @@ -3169,11 +3184,11 @@ func Test_cindent_27() } [CODE] - call append(0, code) + append(0, code) normal gg exe "normal ]]/comment 1/+1\<CR>==" - let expected =<< trim [CODE] + var expected =<< trim [CODE] void f() { statement; @@ -3182,17 +3197,17 @@ func Test_cindent_27() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_28() +def Test_cindent_28() new setl cindent ts=4 sw=4 setl cino=g0 - let code =<< trim [CODE] + var code =<< trim [CODE] class CAbc { int Test() { return FALSE; } @@ -3204,11 +3219,11 @@ func Test_cindent_28() }; [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] class CAbc { int Test() { return FALSE; } @@ -3220,17 +3235,17 @@ func Test_cindent_28() }; [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_29() +def Test_cindent_29() new setl cindent ts=4 sw=4 setl cino=(0,gs,hs - let code =<< trim [CODE] + var code =<< trim [CODE] class Foo : public Bar { public: @@ -3241,11 +3256,11 @@ func Test_cindent_29() }; [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] class Foo : public Bar { public: @@ -3256,17 +3271,17 @@ func Test_cindent_29() }; [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_30() +def Test_cindent_30() new setl cindent ts=4 sw=4 setl cino=+20 - let code =<< [CODE] + var code =<< [CODE] void foo() { @@ -3277,11 +3292,11 @@ foo() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< [CODE] + var expected =<< [CODE] void foo() { @@ -3292,17 +3307,17 @@ foo() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_31() +def Test_cindent_31() new setl cindent ts=4 sw=4 setl cino=(0,W2s - let code =<< trim [CODE] + var code =<< trim [CODE] { averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd( @@ -3342,11 +3357,11 @@ func Test_cindent_31() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] { averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd( @@ -3386,17 +3401,17 @@ func Test_cindent_31() } [CODE] + assert_equal(expected, getline(1, '$')) - call assert_equal(expected, getline(1, '$')) - enew! | close -endfunc + bwipe! +enddef -func Test_cindent_32() +def Test_cindent_32() new setl cindent ts=4 sw=4 setl cino=M1 - let code =<< trim [CODE] + var code =<< trim [CODE] int main () { if (cond1 && @@ -3406,11 +3421,11 @@ func Test_cindent_32() } [CODE] - call append(0, code) + append(0, code) normal gg normal ]]=][ - let expected =<< trim [CODE] + var expected =<< trim [CODE] int main () { if (cond1 && @@ -3420,17 +3435,17 @@ func Test_cindent_32() } [CODE] + assert_equal(expected, getline(1, '$')) |