@@ -127,12 +127,12 @@ describe("telescope.config.resolve", function()
127
127
128
128
describe (" resolve_anchor_pos" , function ()
129
129
local test_sizes = {
130
- { 6 , 7 , 8 , 9 },
131
- { 10 , 20 , 30 , 40 },
132
- { 15 , 15 , 16 , 16 },
133
- { 17 , 19 , 23 , 31 },
134
- { 21 , 18 , 26 , 24 },
135
- { 50 , 100 , 150 , 200 },
130
+ { 6 , 7 , 8 , 9 , 1 },
131
+ { 10 , 20 , 30 , 40 , 1 },
132
+ { 15 , 15 , 16 , 16 , 1 },
133
+ { 17 , 19 , 23 , 31 , 1 },
134
+ { 21 , 18 , 26 , 24 , 1 },
135
+ { 50 , 100 , 150 , 200 , 1 },
136
136
}
137
137
138
138
it ([[ should not adjust when "CENTER" or "" is the anchor]] , function ()
@@ -145,7 +145,7 @@ describe("telescope.config.resolve", function()
145
145
146
146
it ([[ should end up at top when "N" in the anchor]] , function ()
147
147
local top_test = function (anchor , p_width , p_height , max_columns , max_lines )
148
- local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines )
148
+ local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines , 1 )
149
149
eq (1 , pos [2 ] + math.floor ((max_lines - p_height ) / 2 ))
150
150
end
151
151
for _ , s in ipairs (test_sizes ) do
@@ -157,7 +157,7 @@ describe("telescope.config.resolve", function()
157
157
158
158
it ([[ should end up at left when "W" in the anchor]] , function ()
159
159
local left_test = function (anchor , p_width , p_height , max_columns , max_lines )
160
- local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines )
160
+ local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines , 1 )
161
161
eq (1 , pos [1 ] + math.floor ((max_columns - p_width ) / 2 ))
162
162
end
163
163
for _ , s in ipairs (test_sizes ) do
@@ -169,7 +169,7 @@ describe("telescope.config.resolve", function()
169
169
170
170
it ([[ should end up at bottom when "S" in the anchor]] , function ()
171
171
local bot_test = function (anchor , p_width , p_height , max_columns , max_lines )
172
- local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines )
172
+ local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines , 1 )
173
173
eq (max_lines - 1 , pos [2 ] + p_height + math.floor ((max_lines - p_height ) / 2 ))
174
174
end
175
175
for _ , s in ipairs (test_sizes ) do
@@ -181,7 +181,7 @@ describe("telescope.config.resolve", function()
181
181
182
182
it ([[ should end up at right when "E" in the anchor]] , function ()
183
183
local right_test = function (anchor , p_width , p_height , max_columns , max_lines )
184
- local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines )
184
+ local pos = resolve .resolve_anchor_pos (anchor , p_width , p_height , max_columns , max_lines , 1 )
185
185
eq (max_columns - 1 , pos [1 ] + p_width + math.floor ((max_columns - p_width ) / 2 ))
186
186
end
187
187
for _ , s in ipairs (test_sizes ) do
@@ -193,8 +193,8 @@ describe("telescope.config.resolve", function()
193
193
194
194
it ([[ should ignore casing of the anchor]] , function ()
195
195
local case_test = function (a1 , a2 , p_width , p_height , max_columns , max_lines )
196
- local pos1 = resolve .resolve_anchor_pos (a1 , p_width , p_height , max_columns , max_lines )
197
- local pos2 = resolve .resolve_anchor_pos (a2 , p_width , p_height , max_columns , max_lines )
196
+ local pos1 = resolve .resolve_anchor_pos (a1 , p_width , p_height , max_columns , max_lines , 1 )
197
+ local pos2 = resolve .resolve_anchor_pos (a2 , p_width , p_height , max_columns , max_lines , 1 )
198
198
eq (pos1 , pos2 )
199
199
end
200
200
for _ , s in ipairs (test_sizes ) do
0 commit comments