comparison src/testdir/test_lispwords.vim @ 12560:44aa2997239d v8.0.1158

patch 8.0.1158: still old style tests commit https://github.com/vim/vim/commit/db51007108a6ab0671e7f7b4844557cbe647185f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 28 21:52:17 2017 +0200 patch 8.0.1158: still old style tests Problem: Still old style tests. Solution: Convert serveral tests to new style. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Sep 2017 22:00:05 +0200
parents 979f8a595326
children a6a935b3270e
comparison
equal deleted inserted replaced
12559:34c8ec888122 12560:44aa2997239d
12 setlocal lispwords< 12 setlocal lispwords<
13 call assert_equal('foo,bar,baz', &g:lispwords) 13 call assert_equal('foo,bar,baz', &g:lispwords)
14 call assert_equal('foo,bar,baz', &l:lispwords) 14 call assert_equal('foo,bar,baz', &l:lispwords)
15 call assert_equal('foo,bar,baz', &lispwords) 15 call assert_equal('foo,bar,baz', &lispwords)
16 endfunc 16 endfunc
17
18 func Test_lisp_indent()
19 enew!
20
21 call append(0, [
22 \ '(defun html-file (base)',
23 \ '(format nil "~(~A~).html" base))',
24 \ '',
25 \ '(defmacro page (name title &rest body)',
26 \ '(let ((ti (gensym)))',
27 \ '`(with-open-file (*standard-output*',
28 \ '(html-file ,name)',
29 \ ':direction :output',
30 \ ':if-exists :supersede)',
31 \ '(let ((,ti ,title))',
32 \ '(as title ,ti)',
33 \ '(with center ',
34 \ '(as h2 (string-upcase ,ti)))',
35 \ '(brs 3)',
36 \ ',@body))))',
37 \ '',
38 \ ';;; Utilities for generating links',
39 \ '',
40 \ '(defmacro with-link (dest &rest body)',
41 \ '`(progn',
42 \ '(format t "<a href=\"~A\">" (html-file ,dest))',
43 \ ',@body',
44 \ '(princ "</a>")))'
45 \ ])
46 set lisp
47 set lispwords&
48 let save_copt = &cpoptions
49 set cpoptions+=p
50 normal 1G=G
51
52 call assert_equal([
53 \ '(defun html-file (base)',
54 \ ' (format nil "~(~A~).html" base))',
55 \ '',
56 \ '(defmacro page (name title &rest body)',
57 \ ' (let ((ti (gensym)))',
58 \ ' `(with-open-file (*standard-output*',
59 \ ' (html-file ,name)',
60 \ ' :direction :output',
61 \ ' :if-exists :supersede)',
62 \ ' (let ((,ti ,title))',
63 \ ' (as title ,ti)',
64 \ ' (with center ',
65 \ ' (as h2 (string-upcase ,ti)))',
66 \ ' (brs 3)',
67 \ ' ,@body))))',
68 \ '',
69 \ ';;; Utilities for generating links',
70 \ '',
71 \ '(defmacro with-link (dest &rest body)',
72 \ ' `(progn',
73 \ ' (format t "<a href=\"~A\">" (html-file ,dest))',
74 \ ' ,@body',
75 \ ' (princ "</a>")))',
76 \ ''
77 \ ], getline(1, "$"))
78
79 enew!
80 let &cpoptions=save_copt
81 endfunc