aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_functions.vim
Commit message (Collapse)AuthorAge
* vim-patch:9.0.2135: No test for mode() when executing Ex commands (#26282)zeertzjq2023-11-29
| | | | | | | | | Problem: No test for mode() when executing Ex commands Solution: Add some test cases and simplify several other test cases. Also add a few more test cases for ModeChanged. closes: vim/vim#13588 https://github.com/vim/vim/commit/fcaeb3d42b228e73c669b2fce78f1d3fe112769f
* vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)zeertzjq2023-11-28
| | | | | | | | Problem: Cannot detect overstrike mode in Cmdline mode Solution: Make mode() return "cr" for overstrike closes: vim/vim#13569 https://github.com/vim/vim/commit/d1c3ef1f47c87d1da056c56564e1985fe6f2931d
* vim-patch:9.0.2041: trim(): hard to use default mask (#25692)zeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: vim/vim#13358 https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2 vim-patch:9.0.2040: trim(): hard to use default mask Problem: trim(): hard to use default mask Solution: Use default 'mask' when it is v:none The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. 'v:none' is already used to mean "use the default argument value" in user defined functions. See |none-function_argument| in help. closes: vim/vim#13363 https://github.com/vim/vim/commit/6e6386716f9494ae86027c6d34f657fd03dfec42 Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
* vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)zeertzjq2023-10-15
| | | | | | | | | Problem: Cannot accurately get mouse clicking position when clicking on a TAB or with virtual text. Solution: Add a "coladd" field to getmousepos() result. closes: vim/vim#13335 https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
* vim-patch:9.0.2022: getmousepos() returns wrong index for TAB char (#25636)zeertzjq2023-10-14
| | | | | | | | | | | Problem: When clicking in the middle of a TAB, getmousepos() returns the column of the next char instead of the TAB. Solution: Break out of the loop when the vcol to find is inside current char. Fix invalid memory access when calling virtcol2col() on an empty line. closes: vim/vim#13321 https://github.com/vim/vim/commit/b583eda7031b1f6a3469a2537d0c10ca5fa5568e
* vim-patch:9.0.1972: win32: missing '**' expansion test (#25476)zeertzjq2023-10-03
| | | | | | | | | | | | | | | | | | | Problem: win32: missing '**' expansion test (after v9.0.1947) Solution: Add test for MS-Windows win32: Add "**" test Vim supports "**" on MS-Windows. However, it is not tested by `Test_glob_extended_bash`. Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion. So, I added as a separate test. related: vim/vim#13205 closes: vim/vim#13250 https://github.com/vim/vim/commit/4a1ad5556423dca5f5b7ee39f143579e67569ae1 Co-authored-by: Ken Takata <kentkt@csc.jp>
* vim-patch:9.0.1947: Bash Expansion test fails on Windows/MacOSzeertzjq2023-09-29
| | | | | | | | | | | | | | | Problem: Bash Expansion test fails on Windows/MacOS Solution: Disable Test_glob_extended_bash for now This test doesn't work on Windows even if bash can be executed, since the globstar functionality has only been enabled in Unix builds of Vim (Commit 9eb1ce531527a7177d16373b0f8689bbcd3d5f73, patch 9.0.1946). closes: vim/vim#13205 https://github.com/vim/vim/commit/03ca4002c1dcd34c4b17fe4a491b02d77ec2c887 Co-authored-by: Ken Takata <kentkt@csc.jp>
* vim-patch:9.0.1946: filename expansion using ** in bash may failzeertzjq2023-09-29
| | | | | | | | | | | | | | | | | | | | | | | Problem: filename expansion using ** in bash may fail Solution: Try to enable the globstar setting Starting with bash 4.0 it supports extended globbing using the globstar shell option. This makes matching recursively below a certain directory using the ** pattern work as expected nowadays. However, we need to explicitly enable this using the 'shopt -s globstar' bash command. So let's check the bash environment variable $BASH_VERSINFO (which is supported since bash 3.0 and conditionally enable the globstar option, if the major version is at least 4. For older bashs, this at least shouldn't cause errors (unless one is using really ancient bash 2.X or something). closes: vim/vim#13002 closes: vim/vim#13144 https://github.com/vim/vim/commit/9eb1ce531527a7177d16373b0f8689bbcd3d5f73 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.1894: CI: trailing whitespace in testszeertzjq2023-09-11
| | | | | | | | | Problem: CI: trailing white space in tests Solution: clean up the trailing white space https://github.com/vim/vim/commit/e5f7cd0a60d0eeab84f7aeb35c13d3af7e50072e Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.1893: CI: strptime test fails on BSD14zeertzjq2023-09-11
| | | | | | | | | Problem: CI: strptime test fails on BSD14 Solution: Skip the test https://github.com/vim/vim/commit/983d808674f998eaea12b302028de45f1c6857cd Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:partial:9.0.1886: Various Typoszeertzjq2023-09-09
| | | | | | | | | | | | | | | | | | | Problem: Various Typos Solution: Fix Typos This is a collection of typo related commits. closes: vim/vim#12753 closes: vim/vim#13016 https://github.com/vim/vim/commit/ee17b6f70d382ec6c5d8d27b56c4e84106ac8c55 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl> Co-authored-by: Viktor Szépe <viktor@szepe.net> Co-authored-by: nuid64 <lvkuzvesov@proton.me> Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com> Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
* vim-patch:9.0.1846: [security] crash in fullcommandzeertzjq2023-09-03
| | | | | | | | | Problem: crash in fullcommand Solution: Check for typeval correctly https://github.com/vim/vim/commit/4c6fe2e2ea62469642ed1d80b16d39e616b25cf5 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.1779: Need more state() tests (#24840)zeertzjq2023-08-23
| | | | | | | | | Problem: Need more state() tests Solution: Add a few more tests for operater pending mode and register yank command closes: vim/vim#12883 https://github.com/vim/vim/commit/8dabccd295271104ad5af0abc48e283d644cff59
* vim-patch:9.0.0837: append() reports failure when not appending anythingzeertzjq2023-08-22
| | | | | | | | | Problem: append() reports failure when not appending anything. Solution: Only report failure when appending something. (closes vim/vim#11498) https://github.com/vim/vim/commit/cd9c8d400c1eb9cbb4ff6a33be02f91a30ab13b2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4212: window title test still fails in some configurationszeertzjq2023-08-21
| | | | | | | | | Problem: Window title test still fails in some configurations. Solution: Explicitly set the 'title' option. https://github.com/vim/vim/commit/1450112eef2eda211d398d6d7ac03f7a29fa4f55 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4211: window title test still fails in some configurationszeertzjq2023-08-21
| | | | | | | | | Problem: Window title test still fails in some configurations. Solution: Use WaitForAssert(). https://github.com/vim/vim/commit/3a8ad5918b5c1b4c36b39c420ce933b452929dd8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4210: window title test fails in some configurationszeertzjq2023-08-21
| | | | | | | | | Problem: Window title test fails in some configurations. Solution: Only run the test if the title can be obtained. https://github.com/vim/vim/commit/a6c09a7c20dd8dae43a99c6dc634151940c2fc6c Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4208: using setbufvar() may change the window titlezeertzjq2023-08-21
| | | | | | | | | Problem: Using setbufvar() may change the window title. Solution: Do not redraw when creating the autocommand window. (closes vim/vim#9613) https://github.com/vim/vim/commit/dff97e65eb1bb24c44c2b7430a480888d8afb3f4 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3518: Test_xrestore sometimes failszeertzjq2023-08-21
| | | | | | | | | | Problem: Test_xrestore sometimes fails. Solution: Mark the test as flayky. Move marking test as flaky to the test instead of listing them in runtest. https://github.com/vim/vim/commit/f08b0eb8691ff09f98bc4beef986ece1c521655f Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0533: tests using term_wait() can still be flakyzeertzjq2023-08-21
| | | | | | | | | | | Problem: Tests using term_wait() can still be flaky. Solution: Increase the wait time when rerunning a test. (James McCoy, closes vim/vim#5899) Halve the initial times to make tests run faster when there is no rerun. https://github.com/vim/vim/commit/6a2c5a7dd5c9215cc030d5ea6e4616d782c091dd Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0454: some tests fail when the system is slowzeertzjq2023-08-21
| | | | | | | | | | Problem: Some tests fail when the system is slow. Solution: Make the run number global, use in the test to increase the waiting time. (closes vim/vim#5841) https://github.com/vim/vim/commit/3ed9efc2b15b624268bcce4e4d312fb35840a12b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.1.2099: state() test fails on some Mac systemszeertzjq2023-08-21
| | | | | | | | | Problem: state() test fails on some Mac systems. Solution: Increase the wait time. (closes vim/vim#4983) https://github.com/vim/vim/commit/b7a97ef340f03ca08df8c8e00cd5580f61aac824 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.1.2066: no tests for state()zeertzjq2023-08-21
| | | | | | | | | Problem: No tests for state(). Solution: Add tests. Clean up some feature checks. Make "a" flag work. https://github.com/vim/vim/commit/c2585490321854ca3df115efcf0b40986901d96c Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1540: reverse() on string doesn't work in compiled functionzeertzjq2023-08-19
| | | | | | | | | | Problem: reverse() on string doesn't work in compiled function. Solution: Accept string in argument type check. (Yegappan Lakshmanan, closes vim/vim#12377) https://github.com/vim/vim/commit/f9dc278946d52235a0025fd347bd9ff571258470 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1515: reverse() does not work for a Stringzeertzjq2023-08-19
| | | | | | | | | | | | | | | | | | | Problem: reverse() does not work for a String. Solution: Implement reverse() for a String. (Yegappan Lakshmanan, closes vim/vim#12179) https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b vim-patch:9.0.1738: Duplicate code to reverse a string Problem: Duplicate code to reverse a string Solution: Move reverse_text() to strings.c and remove string_reverse(). closes: vim/vim#12847 https://github.com/vim/vim/commit/4dd266cb66d901cf5324f09405cfea3f004bd29f Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1728: missing winid argument for virtcol() (#24770)zeertzjq2023-08-18
| | | | | | | | | | | | | Problem: missing winid argument for virtcol() Solution: Add a {winid} argument to virtcol() Other functions col(), charcol() and virtcol2col() support a {winid} argument, so it makes sense for virtcol() to also support than. Also add test for virtcol2col() with 'showbreak' and {winid}. closes: vim/vim#12633 https://github.com/vim/vim/commit/825cf813fa0fddf085fcbd3194781e875320ff63
* vim-patch:9.0.1722: wrong error messages when passing wrong types to count()zeertzjq2023-08-18
| | | | | | | | | | | | | | | Problem: wrong error messages when passing wrong types to count() Solution: fix it This fixes two problems: 1. When passing wrong type to {ic} argument of count(), two error messages are given, the second of which is misleading. 2. When passing wrong type to {comp} argument of count(), the error message doesn't mention that {comp} may be a String. closes: vim/vim#12825 https://github.com/vim/vim/commit/4f389e7c0fe7dfeccfa512a72fa36f9028d57159
* vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)Gregory Anders2023-07-10
| | | | | | | | Problem: Cannot produce a status 418 or 503 message. Solution: Add err_teapot(). https://github.com/vim/vim/commit/80adaa8ae8398403ca4e9797219ea9a501fc76a5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)zeertzjq2023-06-14
| | | | | | | | Problem: Having utf16idx() rounding up is inconvenient. Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523) https://github.com/vim/vim/commit/95707037afa1aeae4f3494dc623a721ceed7fc4e Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.2949: tests failing because no error for float to string ↵zeertzjq2023-06-12
| | | | | | | | | | | | | conversion Problem: Tests failing because there is no error for float to string conversion. Solution: Change the check for failure to check for correct result. Make some conversions strict in Vim9 script. https://github.com/vim/vim/commit/3cfa5b16b06bcc034f6de77070fa779d698ab5e9 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)zeertzjq2023-06-09
| | | | | | | | | | Problem: charidx() and utf16idx() result is not consistent with byteidx(). Solution: When the index is equal to the length of the text return the lenght of the text instead of -1. (Yegappan Lakshmanan, closes vim/vim#12503) https://github.com/vim/vim/commit/577922b917e48285a7a312daf7b5bbc6e272939c Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1598: screenchar() and others are wrong with DBCS 'encoding' ↵zeertzjq2023-06-02
| | | | | | | | | | (#23872) Problem: screenchar(), screenchars() and screenstring() do not work properly when 'encoding' is set to a double-byte encoding. Solution: Fix the way the bytes of the characters are obtained. (issue vim/vim#12469) https://github.com/vim/vim/commit/47eec6716b8621fd43bac8ecc9c19089df26705e
* vim-patch:9.0.1524: passing -1 for bool is not always rejectedzeertzjq2023-05-08
| | | | | | | Problem: Passing -1 for bool is not always rejected. Solution: Check for error in a better way. (closes vim/vim#12358) https://github.com/vim/vim/commit/8cf51376b842e0060edf08bd2e5bd9933c552ecf
* vim-patch:9.0.1522: some functions give two error messageszeertzjq2023-05-08
| | | | | | | | | | | | Problem: Some functions give two error messages. Solution: Do not give a second error message. (closes vim/vim#12352) https://github.com/vim/vim/commit/e4098457ab9c94225b1b0e3c5e06b82b75587971 It seems that tv_get_bool() is actually not exactly the same as tv_get_number(), so change it to a function instead. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)zeertzjq2023-04-26
| | | | | | | | | Problem: no functions for converting from/to UTF-16 index. Solution: Add UTF-16 flag to existing funtions and add strutf16len() and utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216) https://github.com/vim/vim/commit/67672ef097dd708244ff042a8364994da2b91e75 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:partial:9.0.0359: error message for wrong argument type is not ↵zeertzjq2023-04-25
| | | | | | | | | | | | | specific (#23315) Problem: Error message for wrong argument type is not specific. Solution: Include more information in the error. (Yegappan Lakshmanan, closes vim/vim#11037) https://github.com/vim/vim/commit/8deb2b30c77035bb682ccf80b781455ac1d6038b Skip reduce() and deepcopy() changes because of missing patches. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.0875: using freed memory when executing delfunc at more prompt ↵zeertzjq2023-04-25
| | | | | | | | | | (#23314) Problem: Using freed memory when executing delfunc at the more prompt. Solution: Check function list not changed in another place. (closes vim/vim#11437) https://github.com/vim/vim/commit/398a26f7fcd58fbc6e2329f892edbb7479a971bb Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)zeertzjq2023-04-25
| | | | | | | | | Problem: Cannot get the first screen column of a character. Solution: Let virtcol() optionally return a list. (closes vim/vim#10482, closes vim/vim#7964) https://github.com/vim/vim/commit/0f7a3e1de6f71e8e1423fe594890d6aa7f94e132 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:9.0.0335: checks for Dictionary argument often give a vague error ↵zeertzjq2023-04-25
| | | | | | | | | | | | (#23309) Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009) https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Cherry-pick removal of E922 from docs from patch 9.0.1403. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.3786: test fails because of using Vim9 syntax in legacy functionzeertzjq2023-04-16
| | | | | | | | | | | Problem: Test fails because of using Vim9 syntax in legacy function. Solution: Add "call". https://github.com/vim/vim/commit/4f16e9de985c5178e9cf15d69facfec6f15a5e09 Add test_nested_function.vim changes from patches 8.{0.0141,2.1432}. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3783: confusing error for using a variable as a functionzeertzjq2023-04-16
| | | | | | | | | | Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2977: crash when using a null function referencezeertzjq2023-04-16
| | | | | | | | | Problem: Crash when using a null function reference. (Naohiro Ono) Solution: Check for an invalid function name. (closes vim/vim#8367) https://github.com/vim/vim/commit/22db0d549f64aa3d8a6e366b70eb8d7e66933b82 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2848: crash whn calling partialzeertzjq2023-04-16
| | | | | | | | | Problem: Crash whn calling partial. Solution: Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202) https://github.com/vim/vim/commit/fe8ebdbe5c4e116311c0c0d5937b89ded5c92d01 Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
* vim-patch:8.2.4361: Vim9: some tests failzeertzjq2023-04-15
| | | | | | | | | Problem: Vim9: some tests fail. Solution: Fix the tests, mostly by removing "s:". https://github.com/vim/vim/commit/62b191c38758c835a577ef091a803b6dd4cd4f49 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.0634: crash with null partial and blobzeertzjq2023-04-15
| | | | | | | | | | Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5984) https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* test: move oldtests to test directory (#22536)dundargoc2023-03-07
The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'.