aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/033_lisp_indent_spec.lua
diff options
context:
space:
mode:
authorRainer Borene <rainerborene@gmail.com>2014-11-09 18:26:14 -0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-20 21:06:37 -0300
commitbbd95c051426f1b3b8a200c3aaf44af1d3b01ef1 (patch)
treef49b137a2b3b500822616c37069ab68bb44829a7 /test/functional/legacy/033_lisp_indent_spec.lua
parent8c872a945e3f29b45a19ba7184ca99f88907fe89 (diff)
downloadrneovim-bbd95c051426f1b3b8a200c3aaf44af1d3b01ef1.tar.gz
rneovim-bbd95c051426f1b3b8a200c3aaf44af1d3b01ef1.tar.bz2
rneovim-bbd95c051426f1b3b8a200c3aaf44af1d3b01ef1.zip
legacy tests: migrate test33
Diffstat (limited to 'test/functional/legacy/033_lisp_indent_spec.lua')
-rw-r--r--test/functional/legacy/033_lisp_indent_spec.lua73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua
new file mode 100644
index 0000000000..3ee248815d
--- /dev/null
+++ b/test/functional/legacy/033_lisp_indent_spec.lua
@@ -0,0 +1,73 @@
+-- vim: set foldmethod=marker foldmarker=[[,]] :
+-- Test for 'lisp'
+-- If the lisp feature is not enabled, this will fail!
+
+local helpers = require('test.functional.helpers')
+local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
+local execute, expect = helpers.execute, helpers.expect
+
+describe('lisp indent', function()
+ setup(clear)
+
+ it('is working', function()
+ insert([[
+ (defun html-file (base)
+ (format nil "~(~A~).html" base))
+
+ (defmacro page (name title &rest body)
+ (let ((ti (gensym)))
+ `(with-open-file (*standard-output*
+ (html-file ,name)
+ :direction :output
+ :if-exists :supersede)
+ (let ((,ti ,title))
+ (as title ,ti)
+ (with center
+ (as h2 (string-upcase ,ti)))
+ (brs 3)
+ ,@body))))
+
+ ;;; Utilities for generating links
+
+ (defmacro with-link (dest &rest body)
+ `(progn
+ (format t "<a href=\"~A\">" (html-file ,dest))
+ ,@body
+ (princ "</a>")))]])
+
+ execute('set lisp expandtab')
+ execute('/^(defun')
+ feed('=G:/^(defun/,$yank A<cr>')
+
+ -- Put @a and clean empty line
+ execute('%d')
+ execute('0put a')
+ execute('$d')
+
+ -- Assert buffer contents.
+ expect([[
+ (defun html-file (base)
+ (format nil "~(~A~).html" base))
+
+ (defmacro page (name title &rest body)
+ (let ((ti (gensym)))
+ `(with-open-file (*standard-output*
+ (html-file ,name)
+ :direction :output
+ :if-exists :supersede)
+ (let ((,ti ,title))
+ (as title ,ti)
+ (with center
+ (as h2 (string-upcase ,ti)))
+ (brs 3)
+ ,@body))))
+
+ ;;; Utilities for generating links
+
+ (defmacro with-link (dest &rest body)
+ `(progn
+ (format t "<a href=\"~A\">" (html-file ,dest))
+ ,@body
+ (princ "</a>")))]])
+ end)
+end)