patch 9.0.1540: reverse() on string doesn't work in compiled function
Problem: reverse() on string doesn't work in compiled function.
Solution: Accept string in argument type check. (Yegappan Lakshmanan,
closes #12377)
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 4529a5e..8664724 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -3475,13 +3475,16 @@
" Test for the reverse() function with a string
func Test_string_reverse()
- call assert_equal('', reverse(test_null_string()))
- for [s1, s2] in [['', ''], ['a', 'a'], ['ab', 'ba'], ['abc', 'cba'],
- \ ['abcd', 'dcba'], ['«-«-»-»', '»-»-«-«'],
- \ ['🇦', '🇦'], ['🇦🇧', '🇧🇦'], ['🇦🇧🇨', '🇨🇧🇦'],
- \ ['🇦«ðŸ‡§-🇨»ðŸ‡©', '🇩»ðŸ‡¨-🇧«ðŸ‡¦']]
- call assert_equal(s2, reverse(s1))
- endfor
+ let lines =<< trim END
+ call assert_equal('', reverse(test_null_string()))
+ for [s1, s2] in [['', ''], ['a', 'a'], ['ab', 'ba'], ['abc', 'cba'],
+ \ ['abcd', 'dcba'], ['«-«-»-»', '»-»-«-«'],
+ \ ['🇦', '🇦'], ['🇦🇧', '🇧🇦'], ['🇦🇧🇨', '🇨🇧🇦'],
+ \ ['🇦«ðŸ‡§-🇨»ðŸ‡©', '🇩»ðŸ‡¨-🇧«ðŸ‡¦']]
+ call assert_equal(s2, reverse(s1))
+ endfor
+ END
+ call v9.CheckLegacyAndVim9Success(lines)
" test in latin1 encoding
let save_enc = &encoding