diff src/testdir/test_vim9_expr.vim @ 21512:81c47a694479 v8.2.1306

patch 8.2.1306: checking for first character of dict key is inconsistent Commit: https://github.com/vim/vim/commit/b13ab99908097d54e21ab5adad22f4ad2a8ec688 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 27 21:43:28 2020 +0200 patch 8.2.1306: checking for first character of dict key is inconsistent Problem: Checking for first character of dict key is inconsistent. Solution: Add eval_isdictc(). (closes https://github.com/vim/vim/issues/6546)
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Jul 2020 21:45:04 +0200
parents b5d4ab124782
children 6c67c86a202a
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1310,6 +1310,11 @@ def Test_expr_member()
 		  ])
   assert_equal(1, d
   	.one)
+  d = {'1': 1, '_': 2}
+  assert_equal(1, d
+  	.1)
+  assert_equal(2, d
+  	._)
 
   # getting the one member should clear the dict after getting the item
   assert_equal('one', #{one: 'one'}.one)
@@ -1330,10 +1335,16 @@ def Test_expr_member_vim9script()
       vim9script
       let d = #{one:
       		'one',
-		two: 'two'}
+		two: 'two',
+		1: 1,
+		_: 2}
       assert_equal('one', d.one)
       assert_equal('one', d
                             .one)
+      assert_equal(1, d
+                            .1)
+      assert_equal(2, d
+                            ._)
       assert_equal('one', d[
 			    'one'
 			    ])