patch 8.2.1471: :const only locks the variable, not the value

Problem:    :const only locks the variable, not the value.
Solution:   Lock the value as ":lockvar 1 var" would do. (closes #6719)
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim
index a0f919e..c993f56 100644
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -41,6 +41,7 @@
     call assert_fails('let s = "vim"', 'E741:')
     call assert_fails('let F = funcref("s:noop")', 'E741:')
     call assert_fails('let l = [1, 2, 3]', 'E741:')
+    call assert_fails('call filter(l, "v:val % 2 == 0")', 'E741:')
     call assert_fails('let d = {"foo": 10}', 'E741:')
     if has('channel')
       call assert_fails('let j = test_null_job()', 'E741:')
@@ -276,13 +277,16 @@
     const l = [1, 2, 3]
     const d = {'foo': 10}
 
-    " Modify list
-    call add(l, 4)
+    " Modify list - setting item is OK, adding/removing items not
     let l[0] = 42
+    call assert_fails('call add(l, 4)', 'E741:')
+    call assert_fails('unlet l[1]', 'E741:')
 
-    " Modify dict
-    let d['bar'] = 'hello'
+    " Modify dict - changing item is OK, adding/removing items not
+    let d['foo'] = 'hello'
     let d.foo = 44
+    call assert_fails("let d['bar'] = 'hello'", 'E741:')
+    call assert_fails("unlet d['foo']", 'E741:')
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab