| 1 | Fix test_command_error for neovim 0.12.x.
|
| 2 |
|
| 3 | In neovim 0.12.0, the error message for an invalid cursor position changed from
|
| 4 | "Cursor position outside buffer" to "Invalid cursor line: out of range". Update
|
| 5 | the test to accept both messages.
|
| 6 |
|
| 7 | Taken from upstream commit d89b62ed622976c8d6dbc7733a99dac371b01cbf.
|
| 8 |
|
| 9 | diff --git a/test/test_vim.py b/test/test_vim.py
|
| 10 | index 8a76f5e..26e2fce 100644
|
| 11 | |
| 12 | |
| 13 | @@ -1,6 +1,7 @@
|
| 14 | """Tests interaction with neovim via Nvim API (with child process)."""
|
| 15 |
|
| 16 | import os
|
| 17 | +import re
|
| 18 | import sys
|
| 19 | import tempfile
|
| 20 | from pathlib import Path
|
| 21 | @@ -50,7 +51,7 @@ def test_command_output(vim: Nvim) -> None:
|
| 22 | def test_command_error(vim: Nvim) -> None:
|
| 23 | with pytest.raises(vim.error) as excinfo:
|
| 24 | vim.current.window.cursor = -1, -1
|
| 25 | - assert excinfo.value.args == ('Cursor position outside buffer',)
|
| 26 | + assert re.search(r"Cursor position outside buffer|Invalid cursor line", excinfo.value.args[0])
|
| 27 |
|
| 28 |
|
| 29 | def test_eval(vim: Nvim) -> None:
|