Bram Moolenaar | 41e0f2f | 2016-03-08 14:44:42 +0100 | [diff] [blame] | 1 | " Test for joining lines. |
| 2 | |
| 3 | func 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! |
| 13 | endfunc |
Bram Moolenaar | 53f0c96 | 2017-10-22 14:23:59 +0200 | [diff] [blame] | 14 | |
| 15 | " Tests for setting the '[,'] marks when joining lines. |
| 16 | func 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! |
| 35 | endfunc |