9 Nov 2024 |
realchairforce | Maybe TEST_FILE? | 08:51:40 |
clason | Yes, that | 08:51:50 |
clason | And TEST_FILTER | 08:52:27 |
realchairforce | Nice alright, thank you! | 08:52:42 |
realchairforce | One more question actually if you don't mind. In Neovim / busted tests I'm used to calling Vim API calls directly. But I've noticed there's a lot of indirection in the unittests of other existing _spec.lua files. Why is that?
I'm guessing it has something to do with these sorts of errors when I run the tests. e.g. ERROR test/functional/lua/foobar.lua @ 1285: blah attempt to call field 'cmd' (a nil value) . As in vim.cmd wasn't directly accessible
| 08:54:37 |
clason | Well, depends on whether you want to use the api or test the api | 08:56:34 |
clason | Neovim itself is the test runner for Neovim (different instance) | 08:56:57 |
realchairforce | In this case it'd be test/functionaltest. If that answers your context | 08:57:29 |
clason | No, depends on the actual use, not the file | 08:57:47 |
clason | The runner is minimal and doesn’t have the full (Lua) API | 08:58:20 |
realchairforce | Is the reason why I see exec_lua often in unittests related to this? Something like "escape out to a context that has access to more of the Lua API (because otherwise you'd not have access to the full Lua API)?" | 08:59:42 |
clason | Yea | 08:59:48 |
clason | Well, no | 08:59:55 |
clason | Exec_lua tells the runner to send that code to the instance being tested | 09:00:30 |
clason | Otherwise you would be running the code in the test runner, so you couldn’t catch errors if it failed | 09:01:08 |
realchairforce | Hm okay, definitely a bit if a mental shift but I'll see what I can accomplish from here. Thank you again | 09:02:14 |
| Nacho changed their display name from Nacho Nieva to Nacho. | 23:06:18 |
11 Nov 2024 |
gpanders | In reply to @realchairforce:matrix.org Is the reason why I see exec_lua often in unittests related to this? Something like "escape out to a context that has access to more of the Lua API (because otherwise you'd not have access to the full Lua API)?" It's less "escape out to a context that has access to more of the Lua API" and more "send this code to the Neovim instance under test and run it there". As clason said, when the tests run there are two instances of Neovim running: the instanced running the test and the instance being tested. The former is a barebones Neovim and doesn't include a lot of things, so exec_lua sends a chunk of Lua code to the Neovim instance being tested and runs it there | 14:14:57 |
gpanders | In reply to @realchairforce:matrix.org Is the reason why I see exec_lua often in unittests related to this? Something like "escape out to a context that has access to more of the Lua API (because otherwise you'd not have access to the full Lua API)?" * It's less "escape out to a context that has access to more of the Lua API" and more "send this code to the Neovim instance under test and run it there". As clason said, when the tests run there are two instances of Neovim running: the instance running the test and the instance being tested. The former is a barebones Neovim and doesn't include a lot of things, so exec_lua sends a chunk of Lua code to the Neovim instance being tested and runs it there | 14:15:15 |
13 Nov 2024 |
glepnir | Download image.png | 09:08:09 |
glepnir | Download image.png | 09:08:29 |
glepnir | something wrong in ts-vimdoc? | 09:09:11 |
clason | no, something wrong with the commit | 09:10:12 |
clason | that should be a backtick, not a quote, after the star. | 09:10:52 |
clason | someone should add it to the typo PR | 09:11:27 |
glepnir | oh there generate from commit ? | 09:11:54 |
clason | no | 09:11:59 |
clason | someone wrote this by hand | 09:12:04 |
clason | https://github.com/neovim/neovim/commit/9b357e30fdd0a575480182872331fdb87e9cc331#diff-97a1025f7f83338441026931e13c7d290b607b9dce5c28ebb510ec471fedc085R54 | 09:12:25 |
clason | fixed | 09:14:10 |