aboutsummaryrefslogtreecommitdiff
path: root/test/unit/os/fileio_spec.lua
Commit message (Collapse)AuthorAge
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* refactor(metadata): generate all metadata in luabfredl2024-02-28
| | | | | | | | Then we can just load metadata in C as a single msgpack blob. Which also can be used directly as binarly data, instead of first unpacking all the functions and ui_events metadata to immediately pack it again, which was a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object` which will get yak shaved in the next PR)
* refactor(fileio): remove API shell layer encouraging unnecessary allocationsbfredl2024-02-25
| | | | | | | | | | | | | | | | | | | | | | | | Functions like file_open_new() and file_open_fd_new() which just is a wrapper around the real functions but with an extra xmalloc/xfree around is an anti-pattern. If the caller really needs to allocate a FileDescriptor as a heap object, it can do that directly. FileDescriptor by itself is pretty much a pointer, or rather two: the OS fd index and a pointer to a buffer. So most of the time an extra pointer layer is just wasteful. In the case of scriptin[curscript] in getchar.c, curscript used to mean in practice: N+1 open scripts when curscript>0 zero or one open scripts when curscript==0 Which means scriptin[0] had to be compared to NULL to disambiguate the curscript=0 case. Instead, use curscript==-1 to mean that are no script, then all pointer comparisons dissappear and we can just use an array of structs without extra pointers.
* test: use vim.mpack and vim.uv directlyLewis Russell2024-01-12
|
* build: enable lintlua for test/unit/ dir #26396Justin M. Keyes2023-12-04
| | | | | | | | | | | | | Problem: Not all Lua code is checked by stylua. Automating code-style is an important mechanism for reducing time spent on accidental (non-essential) complexity. Solution: - Enable lintlua for `test/unit/` directory. - TODO: only `test/functional/` remains unchecked. previous: 45fe4d11add933df76a2ea4bf52ce8904f4a778b previous: 517f0cc634b985057da5b95cf4ad659ee456a77e
* test: replace lfs with luv and vim.fsdundargoc2023-04-04
| | | | | | test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
* Merge branch 'master' into s-dash-stdinZyX2017-12-03
|\
| * os/fileio: Add ability to use os/fileio.c for file descriptorsZyX2017-07-04
| | | | | | | | Code imported from #6299
| * os/fileio: Add msgpack_file_write functionZyX2017-07-04
| |
| * tests: Fix testlint errorsZyX2017-04-03
| |
| * eval: Make writefile() able to disable fsync()ZyX2017-04-02
| |
| * eval,fileio: Omit additional fsync() callZyX2017-04-01
| | | | | | | | Fixes #6420
* | unittests: Add tests for new fileio functionsZyX2017-03-19
|/
* unittests: Check core dumps in after_each, like in functestsZyX2017-03-11
|
* unittests: Run all unit tests in their own processesZyX2017-03-11
| | | | | | | | | | | | | | | Used sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua to alter all tests. Locally they all run fine now. Reasoning: 1. General: state from one test should not affect other tests. 2. Local: travis build is failing with something which may be an output of garbage collector. This should prevent state of the garbage collector from interferring as well.
* unittests: Fix testlint errorsZyX2016-06-24
|
* unittests: Fix kFileNoSymlink test on FreeBSDZyX2016-06-24
| | | | | | | | | | | Actual value on FreeBSD is -31, UV_EMLINK was obtained from /usr/include/asm-generic/errno-base.h (there EMLINK is defined as 31 there). This may actually be something else, but I do not think so as “Too many links” description also fits in. [Man page][1] agrees with me, search for `[EMLINK]` ([linux man page][2] also specifies ELOOP explicitly in a similar section). [1]: https://www.freebsd.org/cgi/man.cgi?query=open&sektion=2 [2]: http://man7.org/linux/man-pages/man3/open.3p.html
* unittests: Fix bug somewhere that makes file_read tests SEGVZyX2016-06-24
|
* file: Move src/nvim/file.* to src/nvim/os/fileio.*ZyX2016-06-24