view src/testdir/test_source_utf8.vim @ 33002:b4efdb3357f7 v9.0.1793

patch 9.0.1793: obsolete macros in configure script Commit: https://github.com/vim/vim/commit/f39842f148c9a8112432644b7f4a0129315de771 Author: Illia Bobyr <illia.bobyr@gmail.com> Date: Sun Aug 27 18:21:23 2023 +0200 patch 9.0.1793: obsolete macros in configure script Problem: obsolete macros in configure script Solution: Remove those and start moving to autoconf 2.71 src/configure.ac: Remove obsolete macros These macros are declared obsolete in autoconf 2.69, which is almost 10 years old by now: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html They generate warnings when in a subsequent upgrade to autoconf 2.71. `autoupdate` from autoupdate 2.71 suggests most of these changes, except that it also adds obsolete warnings, that where individually checked and removed. Regenerated `src/auto/configure` by running: cd src autoconf2.69 --output=auto/configure configure.ac sed --in-place --expression='s@>config.log@>auto/config.log@g' auto/configure closes: #12888 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 18:30:04 +0200
parents ae10b91ac6b3
children
line wrap: on
line source

" Test the :source! command

source check.vim

func Test_source_utf8()
  " check that sourcing a script with 0x80 as second byte works
  new
  call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g'])
  write! Xscript
  bwipe!
  new
  call setline(1, [' àx ', ' Àx '])
  source! Xscript | echo
  call assert_equal(' --à1234-- ', getline(1))
  call assert_equal(' --À1234-- ', getline(2))
  bwipe!
  call delete('Xscript')
endfunc

func Test_source_latin()
  " check that sourcing a latin1 script with a 0xc0 byte works
  new
  call setline(1, ["call feedkeys('r')", "call feedkeys('\xc0', 'xt')"])
  write! Xscript
  bwipe!
  new
  call setline(1, ['xxx'])
  source Xscript
  call assert_equal("\u00c0xx", getline(1))
  bwipe!
  call delete('Xscript')
endfunc

" Test for sourcing a file with CTRL-V's at the end of the line
func Test_source_ctrl_v()
  call writefile(['map __1 afirst',
        \ 'map __2 asecond',
        \ 'map __3 athird',
        \ 'map __4 afourth',
        \ 'map __5 afifth',
        \ "map __1 asd\<C-V>",
        \ "map __2 asd\<C-V>\<C-V>",
        \ "map __3 asd\<C-V>\<C-V>",
        \ "map __4 asd\<C-V>\<C-V>\<C-V>",
        \ "map __5 asd\<C-V>\<C-V>\<C-V>",
        \ ], 'Xtestfile', 'D')
  source Xtestfile
  enew!
  exe "normal __1\<Esc>\<Esc>__2\<Esc>__3\<Esc>\<Esc>__4\<Esc>__5\<Esc>"
  exe "%s/\<C-J>/0/g"
  call assert_equal(['sd',
        \ "map __2 asd\<Esc>secondsd\<Esc>sd0map __5 asd0fifth"],
        \ getline(1, 2))

  enew!
  unmap __1
  unmap __2
  unmap __3
  unmap __4
  unmap __5
endfunc

" vim: shiftwidth=2 sts=2 expandtab