mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Problem: Vim9: can still use the depricated #{} dict syntax. Solution: Remove support for #{} in Vim9 script. (closes #7406, closes #7405)
This commit is contained in:
@@ -251,18 +251,18 @@ def Test_skipped_expr_linebreak()
|
||||
enddef
|
||||
|
||||
def Test_dict_member()
|
||||
var test: dict<list<number>> = {'data': [3, 1, 2]}
|
||||
var test: dict<list<number>> = {data: [3, 1, 2]}
|
||||
test.data->sort()
|
||||
assert_equal(#{data: [1, 2, 3]}, test)
|
||||
assert_equal({data: [1, 2, 3]}, test)
|
||||
test.data
|
||||
->reverse()
|
||||
assert_equal(#{data: [3, 2, 1]}, test)
|
||||
assert_equal({data: [3, 2, 1]}, test)
|
||||
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
var test: dict<list<number>> = {'data': [3, 1, 2]}
|
||||
var test: dict<list<number>> = {data: [3, 1, 2]}
|
||||
test.data->sort()
|
||||
assert_equal(#{data: [1, 2, 3]}, test)
|
||||
assert_equal({data: [1, 2, 3]}, test)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
@@ -308,9 +308,9 @@ def Test_bar_after_command()
|
||||
enddef
|
||||
|
||||
def Test_filter_is_not_modifier()
|
||||
var tags = [{'a': 1, 'b': 2}, {'x': 3, 'y': 4}]
|
||||
var tags = [{a: 1, b: 2}, {x: 3, y: 4}]
|
||||
filter(tags, { _, v -> has_key(v, 'x') ? 1 : 0 })
|
||||
assert_equal([#{x: 3, y: 4}], tags)
|
||||
assert_equal([{x: 3, y: 4}], tags)
|
||||
enddef
|
||||
|
||||
def Test_command_modifier_filter()
|
||||
|
Reference in New Issue
Block a user