annotate src/testdir/test_let.vim @ 11961:0240e7e3d736 v8.0.0861

patch 8.0.0861: still many old style tests commit https://github.com/vim/vim/commit/4a137b45864310060410f34cb9c7d0f0231bb256 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 4 22:37:11 2017 +0200 patch 8.0.0861: still many old style tests Problem: Still many old style tests. Solution: Convert several tests to new style. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Fri, 04 Aug 2017 22:45:04 +0200
parents
children dff66c4670b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11961
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for the :let command.
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_let()
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Test to not autoload when assigning. It causes internal error.
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 set runtimepath+=./sautest
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let Test104#numvar = function('tr')
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call assert_equal("function('tr')", string(Test104#numvar))
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 let a = 1
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 let b = 2
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 let out = execute('let a b')
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s = "\na #1\nb #2"
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal(s, out)
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let out = execute('let {0 == 1 ? "a" : "b"}')
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 let s = "\nb #2"
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal(s, out)
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let out = execute('let {0 == 1 ? "a" : "b"} a')
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 let s = "\nb #2\na #1"
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal(s, out)
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 let out = execute('let a {0 == 1 ? "a" : "b"}')
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let s = "\na #1\nb #2"
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call assert_equal(s, out)
0240e7e3d736 patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 endfunc