diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-09 07:18:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-09 07:18:21 +0800 |
commit | b8e227b621468a6ce968f631e4b933f7c12e6955 (patch) | |
tree | 8f73387ddc9e9d6e45004dbd2913a254ba4c10fa /test | |
parent | 9706ee59d0e2143d40d40b9e01cd63f8a17a09ab (diff) | |
download | rneovim-b8e227b621468a6ce968f631e4b933f7c12e6955.tar.gz rneovim-b8e227b621468a6ce968f631e4b933f7c12e6955.tar.bz2 rneovim-b8e227b621468a6ce968f631e4b933f7c12e6955.zip |
vim-patch:9.0.2154: The option[] array is not sorted (#26475)
Problem: The options[] array is not sorted alphabetically.
Solution: Sort it alphabetically. Add a test. Avoid unnecessary loop
iterations in findoption().
closes: vim/vim#13648
Cherry-pick Test_set_one_column() change from patch 8.2.0432.
https://github.com/vim/vim/commit/f48558e10a08a1a483e25ef847bbceeac6b44561
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_options.vim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim index d69828dc2e..2bba86fe99 100644 --- a/test/old/testdir/test_options.vim +++ b/test/old/testdir/test_options.vim @@ -950,8 +950,10 @@ endfunc func Test_set_one_column() let out_mult = execute('set all')->split("\n") let out_one = execute('set! all')->split("\n") - " one column should be two to four times as many lines - call assert_inrange(len(out_mult) * 2, len(out_mult) * 4, len(out_one)) + call assert_true(len(out_mult) < len(out_one)) + call assert_equal(out_one[0], '--- Options ---') + let options = out_one[1:]->mapnew({_, line -> line[2:]}) + call assert_equal(sort(copy(options)), options) endfunc func Test_set_values() |