Mercurial > vim
annotate src/testdir/test_lispwords.vim @ 17688:c945f1d03b1c v8.1.1841
patch 8.1.1841: no test for Ex shift commands
commit https://github.com/vim/vim/commit/d5e3cc11d391f3aa80bf66f91001f11a3a145b43
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 12 14:38:02 2019 +0200
patch 8.1.1841: no test for Ex shift commands
Problem: No test for Ex shift commands.
Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/4801)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 12 Aug 2019 14:45:05 +0200 |
parents | a6a935b3270e |
children | 2e53305f2239 |
rev | line source |
---|---|
7293
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for 'lispwords' settings being global-local |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 set nocompatible viminfo+=nviminfo |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_global_local_lispwords() |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 setglobal lispwords=foo,bar,baz |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 setlocal lispwords-=foo | setlocal lispwords+=quux |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal('foo,bar,baz', &g:lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call assert_equal('bar,baz,quux', &l:lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_equal('bar,baz,quux', &lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 setlocal lispwords< |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal('foo,bar,baz', &g:lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('foo,bar,baz', &l:lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal('foo,bar,baz', &lispwords) |
979f8a595326
commit https://github.com/vim/vim/commit/6cd1345307440491580e5e86cb82c54ee9a46baa
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 endfunc |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
17 |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
18 func Test_lisp_indent() |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
19 enew! |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
20 |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
21 call append(0, [ |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
22 \ '(defun html-file (base)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
23 \ '(format nil "~(~A~).html" base))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
24 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
25 \ '(defmacro page (name title &rest body)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
26 \ '(let ((ti (gensym)))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
27 \ '`(with-open-file (*standard-output*', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
28 \ '(html-file ,name)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
29 \ ':direction :output', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
30 \ ':if-exists :supersede)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
31 \ '(let ((,ti ,title))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
32 \ '(as title ,ti)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
33 \ '(with center ', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
34 \ '(as h2 (string-upcase ,ti)))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
35 \ '(brs 3)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
36 \ ',@body))))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
37 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
38 \ ';;; Utilities for generating links', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
39 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
40 \ '(defmacro with-link (dest &rest body)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
41 \ '`(progn', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
42 \ '(format t "<a href=\"~A\">" (html-file ,dest))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
43 \ ',@body', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
44 \ '(princ "</a>")))' |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
45 \ ]) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
46 set lisp |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
47 set lispwords& |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
48 let save_copt = &cpoptions |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
49 set cpoptions+=p |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
50 normal 1G=G |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
51 |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
52 call assert_equal([ |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
53 \ '(defun html-file (base)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
54 \ ' (format nil "~(~A~).html" base))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
55 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
56 \ '(defmacro page (name title &rest body)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
57 \ ' (let ((ti (gensym)))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
58 \ ' `(with-open-file (*standard-output*', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
59 \ ' (html-file ,name)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
60 \ ' :direction :output', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
61 \ ' :if-exists :supersede)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
62 \ ' (let ((,ti ,title))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
63 \ ' (as title ,ti)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
64 \ ' (with center ', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
65 \ ' (as h2 (string-upcase ,ti)))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
66 \ ' (brs 3)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
67 \ ' ,@body))))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
68 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
69 \ ';;; Utilities for generating links', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
70 \ '', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
71 \ '(defmacro with-link (dest &rest body)', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
72 \ ' `(progn', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
73 \ ' (format t "<a href=\"~A\">" (html-file ,dest))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
74 \ ' ,@body', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
75 \ ' (princ "</a>")))', |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
76 \ '' |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
77 \ ], getline(1, "$")) |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
78 |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
79 enew! |
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
80 let &cpoptions=save_copt |
12688
a6a935b3270e
patch 8.0.1222: test functions interfere with each other
Christian Brabandt <cb@256bit.org>
parents:
12560
diff
changeset
|
81 set nolisp |
12560
44aa2997239d
patch 8.0.1158: still old style tests
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
82 endfunc |