aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-15 17:51:39 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-15 18:19:17 +0800
commitef9af89da753235c64cbd8b7d700c686bc94dad7 (patch)
tree70de460c6f4c421eab66cb202aebfa2b9a166875 /test
parentbacb5021d4eff33c67eb659fb01125b2abcacd79 (diff)
downloadrneovim-ef9af89da753235c64cbd8b7d700c686bc94dad7.tar.gz
rneovim-ef9af89da753235c64cbd8b7d700c686bc94dad7.tar.bz2
rneovim-ef9af89da753235c64cbd8b7d700c686bc94dad7.zip
vim-patch:8.2.4930: interpolated string expression requires escaping
Problem: Interpolated string expression requires escaping. Solution: Do not require escaping in the expression. https://github.com/vim/vim/commit/0abc2871c105882ed1c1effb9a7757fad8a395bd Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_expr.vim8
-rw-r--r--test/old/testdir/test_let.vim5
2 files changed, 6 insertions, 7 deletions
diff --git a/test/old/testdir/test_expr.vim b/test/old/testdir/test_expr.vim
index 86e720a1ae..dee7266bb5 100644
--- a/test/old/testdir/test_expr.vim
+++ b/test/old/testdir/test_expr.vim
@@ -855,7 +855,7 @@ func Test_string_interp()
#" Escaping rules.
call assert_equal('"foo"{bar}', $"\"foo\"{{bar}}")
call assert_equal('"foo"{bar}', $'"foo"{{bar}}')
- call assert_equal('foobar', $"{\"foo\"}" .. $'{''bar''}')
+ call assert_equal('foobar', $"{"foo"}" .. $'{'bar'}')
#" Whitespace before/after the expression.
call assert_equal('3', $"{ 1 + 2 }")
#" String conversion.
@@ -865,8 +865,8 @@ func Test_string_interp()
call assert_equal(string(v:true), $"{v:true}")
call assert_equal('(1+1=2)', $"(1+1={1 + 1})")
#" Hex-escaped opening brace: char2nr('{') == 0x7b
- call assert_equal('esc123ape', $"esc\x7b123}ape")
- call assert_equal('me{}me', $"me{\x7b}\x7dme")
+ call assert_equal('esc123ape', $"esc{123}ape")
+ call assert_equal('me{}me', $"me{"\x7b"}\x7dme")
VAR var1 = "sun"
VAR var2 = "shine"
call assert_equal('sunshine', $"{var1}{var2}")
@@ -874,7 +874,7 @@ func Test_string_interp()
#" Multibyte strings.
call assert_equal('say ハロー・ワールド', $"say {'ハロー・ワールド'}")
#" Nested.
- call assert_equal('foobarbaz', $"foo{$\"{'bar'}\"}baz")
+ call assert_equal('foobarbaz', $"foo{$"{'bar'}"}baz")
#" Do not evaluate blocks when the expr is skipped.
VAR tmp = 0
if v:false
diff --git a/test/old/testdir/test_let.vim b/test/old/testdir/test_let.vim
index 8f7121935e..0d84164274 100644
--- a/test/old/testdir/test_let.vim
+++ b/test/old/testdir/test_let.vim
@@ -393,9 +393,8 @@ func Test_let_interpolated()
let text = 'text'
call assert_equal('text{{', $'{text .. "{{"}')
call assert_equal('text{{', $"{text .. '{{'}")
- " FIXME: should not need to escape quotes in the expression
- call assert_equal('text{{', $'{text .. ''{{''}')
- call assert_equal('text{{', $"{text .. \"{{\"}")
+ call assert_equal('text{{', $'{text .. '{{'}')
+ call assert_equal('text{{', $"{text .. "{{"}")
endfunc
" Test for the setting a variable using the heredoc syntax.