blob: 1c97414164120f98c183d11a9709899137466d8c [file] [log] [blame]
Bram Moolenaar41e0f2f2016-03-08 14:44:42 +01001" Test for joining lines.
2
3func Test_join_with_count()
4 new
5 call setline(1, ['one', 'two', 'three', 'four'])
6 normal J
7 call assert_equal('one two', getline(1))
8 %del
9 call setline(1, ['one', 'two', 'three', 'four'])
10 normal 10J
11 call assert_equal('one two three four', getline(1))
12 quit!
13endfunc
Bram Moolenaar53f0c962017-10-22 14:23:59 +020014
15" Tests for setting the '[,'] marks when joining lines.
16func Test_join_marks()
17 enew
18 call append(0, [
19 \ "\t\tO sodales, ludite, vos qui",
20 \ "attamen consulite per voster honur. Tua pulchra " .
21 \ "facies me fay planszer milies",
22 \ "",
23 \ "This line.",
24 \ "Should be joined with the next line",
25 \ "and with this line"])
26
27 normal gg0gqj
28 call assert_equal([0, 1, 1, 0], getpos("'["))
29 call assert_equal([0, 2, 1, 0], getpos("']"))
30
31 /^This line/;'}-join
32 call assert_equal([0, 4, 11, 0], getpos("'["))
33 call assert_equal([0, 4, 67, 0], getpos("']"))
34 enew!
35endfunc