@@ -16,13 +16,25 @@ describe("In a C Sharp file", function()
1616 h .assert_cursor_at (27 , 5 )
1717 tw .move_down ()
1818 h .assert_cursor_at (50 , 5 )
19+ tw .move_up ()
20+ h .assert_cursor_at (27 , 5 )
1921 tw .move_in ()
20- h .assert_cursor_at (52 , 9 )
22+ h .assert_cursor_at (29 , 9 )
23+ tw .move_down ()
24+ h .assert_cursor_at (31 , 9 )
25+ tw .move_down ()
26+ h .assert_cursor_at (36 , 9 )
27+ tw .move_down ()
28+ h .assert_cursor_at (41 , 9 )
29+ tw .move_up ()
30+ h .assert_cursor_at (36 , 9 )
31+ tw .move_up ()
32+ h .assert_cursor_at (31 , 9 )
2133 tw .move_out ()
22- h .assert_cursor_at (50 , 5 )
34+ h .assert_cursor_at (27 , 5 )
2335 end )
2436
25- it (" swaps down" , function ()
37+ it (" swaps down classes " , function ()
2638 vim .fn .cursor (7 , 5 )
2739 local first_block = lines .get_lines (6 , 24 )
2840 local second_block = lines .get_lines (26 , 48 )
@@ -32,7 +44,17 @@ describe("In a C Sharp file", function()
3244 h .assert_cursor_at (31 , 5 )
3345 end )
3446
35- it (" swaps up" , function ()
47+ it (" swaps down functions" , function ()
48+ vim .fn .cursor (31 , 9 )
49+ local first_block = lines .get_lines (31 , 34 )
50+ local second_block = lines .get_lines (36 , 39 )
51+ tw .swap_down ()
52+ assert .same (second_block , lines .get_lines (31 , 34 ))
53+ assert .same (first_block , lines .get_lines (36 , 39 ))
54+ h .assert_cursor_at (36 , 9 )
55+ end )
56+
57+ it (" swaps up classes" , function ()
3658 vim .fn .cursor (27 , 5 )
3759 local first_block = lines .get_lines (6 , 24 )
3860 local second_block = lines .get_lines (26 , 48 )
@@ -41,4 +63,15 @@ describe("In a C Sharp file", function()
4163 assert .same (first_block , lines .get_lines (30 , 48 ))
4264 h .assert_cursor_at (7 , 5 )
4365 end )
66+
67+ it (" swaps up functions" , function ()
68+ vim .fn .cursor (36 , 9 )
69+ local first_block = lines .get_lines (31 , 34 )
70+ local second_block = lines .get_lines (36 , 39 )
71+ tw .swap_up ()
72+ assert .same (second_block , lines .get_lines (31 , 34 ))
73+ assert .same (first_block , lines .get_lines (36 , 39 ))
74+ h .assert_cursor_at (31 , 9 )
75+ end )
76+
4477end )
0 commit comments