aboutsummaryrefslogtreecommitdiff
path: root/test/unit/strings_spec.lua
Commit message (Collapse)AuthorAge
* test(unit/strings_spec): use correct type for binary valuesJames McCoy2025-01-29
| | | | | When 9.0.1856 was ported, the numbers being formatted as binary were cast to "unsigned int" rather than uvarnumber_T, as is done upstream.
* test(unit/strings_spec): provide context for vim_snprintf testsJames McCoy2025-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Since these assertions all use a common function to perform the test assertions, it's difficult to figure out which test failed: ERROR test/unit/testutil.lua @ 785: vim_snprintf() positional arguments test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) ' test/unit/strings_spec.lua:143: Expected objects to be the same. Passed in: (number) 6400 Expected: (number) 6' exit code: 256 Adding context to the assertion makes it clearer what the problem is: ERROR test/unit/testutil.lua @ 785: vim_snprintf() positional arguments test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) ' test/unit/strings_spec.lua:149: snprintf(buf, 0, "%1$0.*2$b", cdata<unsigned int>: 0xf78d0f38, cdata<int>: 0xf78dc4e0) = 001100 Expected objects to be the same. Passed in: (number) 6400 Expected: (number) 6' exit code: 256
* fix(test): fix strings_spec.lua for AArch64Joey Gouly2024-04-12
| | | | | | | | | | | LuaJIT does not handle -0.0 correctly in 'dual number mode' (which is the default, and only supported mode for LuaJIT arm64). If LuaJIT is forced to use 'dual number mode' on X64 (where the default is single), this test will fail in the same manner. Fix this by using tonumber("-0.0") instead of a -0.0 literal. See: https://github.com/LuaJIT/LuaJIT/issues/858
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* 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
* vim-patch:9.0.1856: issues with formatting positional arguments (#25013)zeertzjq2023-09-04
| | | | | | | | | | | | | Problem: issues with formatting positional arguments Solution: fix them, add tests and documentation closes: vim/vim#12140 closes: vim/vim#12985 Tentatively fix message_test. Check NULL ptr. https://github.com/vim/vim/commit/aa90d4f031f73a34aaef5746931ea746849a2231 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* vim-patch:9.0.1715: duplicate test in message_test.c (#24728)zeertzjq2023-08-16
| | | | | | | | Problem: duplicate test in message_test.c Solution: Remove duplicate test and make functions static closes: vim/vim#12803 https://github.com/vim/vim/commit/7772c93a3ec1ce60469e9aea9899687ae1141f34
* fix(printf): make positional %zd and %zu work (#24722)zeertzjq2023-08-15
|
* vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)zeertzjq2023-08-15
| | | | | | | | | | Problem: Cannot use positional arguments for printf() Solution: Support positional arguments in string formatting closes: vim/vim#12140 https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* vim-patch:8.2.0066: some corners of vim_snprintf() are not tested (#24718)zeertzjq2023-08-15
| | | | | | Problem: Some corners of vim_snprintf() are not tested. Solution: Add a test in C. (Dominique Pelle, closes vim/vim#5422) https://github.com/vim/vim/commit/d2c946bacfedf4e506a4c6771758beddb87df3af
* refactor: move reverse_text to strings.c as it's a string operationDundar Goc2022-05-20
| | | | | | Also add tests for reverse_text. Co-authored-by: Kalle Ranki <kalle.ranki@gmail.com>
* test(strcase_save): test overlong UTF8-encodingDundar Göc2022-03-05
|
* tests: Add tests for vim_strchrZyX2017-05-09
|
* 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.
* build: Target luacheck HEAD.Justin M. Keyes2016-11-17
| | | | | | | | | | | | https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606 > If you really want to use bleeding-edge version you should get the > rockspec from master branch, not a fixed commit ... > The correct way to install from a specific commit is cloning that > commit and running "luarocks make" from project directory. The reason > is that running "install" or "build" on an scm rockspec fetches > sources from master but uses build description from the rockspec > itself, which may be outdated.
* add test for vim_strsave_escaped() functionSergey Golovin2016-05-29
|
* Tests: fix according to lualintMarco Hinz2016-02-02
|
* shell: Unquote &shell* options before using themZyX2016-01-11