diff src/testdir/test_utf8.vim @ 31760:f348559ce426 v9.0.1212

patch 9.0.1212: cannot read back what setcellwidths() has done Commit: https://github.com/vim/vim/commit/66bb9ae70f7371456ed76518076d2a344f8ab417 Author: Kota Kato <github@kat0h.com> Date: Tue Jan 17 18:31:56 2023 +0000 patch 9.0.1212: cannot read back what setcellwidths() has done Problem: Cannot read back what setcellwidths() has done. Solution: Add getcellwidths(). (Kota Kato, closes https://github.com/vim/vim/issues/11837)
author Bram Moolenaar <Bram@vim.org>
date Tue, 17 Jan 2023 19:45:05 +0100
parents 9e1062b4aa94
children a19ef442c77a
line wrap: on
line diff
--- a/src/testdir/test_utf8.vim
+++ b/src/testdir/test_utf8.vim
@@ -199,6 +199,26 @@ func Test_setcellwidths()
   call setcellwidths([])
 endfunc
 
+func Test_getcellwidths()
+  call setcellwidths([])
+  call assert_equal([], getcellwidths())
+
+  let widthlist = [
+        \ [0x1330, 0x1330, 2],
+        \ [9999, 10000, 1],
+        \ [0x1337, 0x1339, 2],
+        \]
+  let widthlistsorted = [
+        \ [0x1330, 0x1330, 2],
+        \ [0x1337, 0x1339, 2],
+        \ [9999, 10000, 1],
+        \]
+  call setcellwidths(widthlist)
+  call assert_equal(widthlistsorted, getcellwidths())
+
+  call setcellwidths([])
+endfunc
+
 func Test_setcellwidths_dump()
   CheckRunVimInTerminal