@@ 292-303 (lines=12) @@ | ||
289 | prompt.nvim.call.assert_called_with('setreg', 'a', 'Hello Goodbye') |
|
290 | ||
291 | ||
292 | def test_yank_to_default_register(prompt, action): |
|
293 | prompt.nvim.vvars = { |
|
294 | 'register': '*', |
|
295 | } |
|
296 | prompt.nvim.call = MagicMock() |
|
297 | prompt.nvim.command = MagicMock() |
|
298 | prompt.text = 'Hello Goodbye' |
|
299 | prompt.caret.locus = 5 |
|
300 | assert action.call(prompt, 'prompt:yank_to_default_register') is None |
|
301 | assert prompt.text == 'Hello Goodbye' |
|
302 | assert prompt.caret.locus == 5 |
|
303 | prompt.nvim.call.assert_called_with('setreg', '*', 'Hello Goodbye') |
|
304 | ||
@@ 265-276 (lines=12) @@ | ||
262 | assert prompt.caret.locus == 8 |
|
263 | ||
264 | ||
265 | def test_paste_from_default_register(prompt, action): |
|
266 | prompt.nvim.vvars = { |
|
267 | 'register': '*', |
|
268 | } |
|
269 | prompt.nvim.call = MagicMock() |
|
270 | prompt.nvim.command = MagicMock() |
|
271 | prompt.nvim.call.side_effect = lambda fname, reg: '<%s>' % reg |
|
272 | prompt.text = 'Hello Goodbye' |
|
273 | prompt.caret.locus = 5 |
|
274 | assert action.call(prompt, 'prompt:paste_from_default_register') is None |
|
275 | assert prompt.text == 'Hello<*> Goodbye' |
|
276 | assert prompt.caret.locus == 8 |
|
277 | ||
278 | ||
279 | def test_yank_to_register(prompt, action): |
|
@@ 279-289 (lines=11) @@ | ||
276 | assert prompt.caret.locus == 8 |
|
277 | ||
278 | ||
279 | def test_yank_to_register(prompt, action): |
|
280 | prompt.nvim.eval = MagicMock() |
|
281 | prompt.nvim.call = MagicMock() |
|
282 | prompt.nvim.command = MagicMock() |
|
283 | prompt.nvim.eval.return_value = 'a' |
|
284 | prompt.text = 'Hello Goodbye' |
|
285 | prompt.caret.locus = 5 |
|
286 | assert action.call(prompt, 'prompt:yank_to_register') is None |
|
287 | assert prompt.text == 'Hello Goodbye' |
|
288 | assert prompt.caret.locus == 5 |
|
289 | prompt.nvim.call.assert_called_with('setreg', 'a', 'Hello Goodbye') |
|
290 | ||
291 | ||
292 | def test_yank_to_default_register(prompt, action): |