From bbd95c051426f1b3b8a200c3aaf44af1d3b01ef1 Mon Sep 17 00:00:00 2001 From: Rainer Borene Date: Sun, 9 Nov 2014 18:26:14 -0200 Subject: legacy tests: migrate test33 --- src/nvim/testdir/test33.in | 34 ------------ src/nvim/testdir/test33.ok | 23 -------- test/functional/legacy/033_lisp_indent_spec.lua | 73 +++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 57 deletions(-) delete mode 100644 src/nvim/testdir/test33.in delete mode 100644 src/nvim/testdir/test33.ok create mode 100644 test/functional/legacy/033_lisp_indent_spec.lua diff --git a/src/nvim/testdir/test33.in b/src/nvim/testdir/test33.in deleted file mode 100644 index 5644760402..0000000000 --- a/src/nvim/testdir/test33.in +++ /dev/null @@ -1,34 +0,0 @@ -Test for 'lisp' -If the lisp feature is not enabled, this will fail! - -STARTTEST -:so small.vim -:set lisp -/^(defun -=G:/^(defun/,$w! test.out -:q! -ENDTEST - -(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 "" (html-file ,dest)) -,@body -(princ ""))) diff --git a/src/nvim/testdir/test33.ok b/src/nvim/testdir/test33.ok deleted file mode 100644 index cd1d87a14b..0000000000 --- a/src/nvim/testdir/test33.ok +++ /dev/null @@ -1,23 +0,0 @@ -(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 "" (html-file ,dest)) - ,@body - (princ ""))) 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 "" (html-file ,dest)) + ,@body + (princ "")))]]) + + execute('set lisp expandtab') + execute('/^(defun') + feed('=G:/^(defun/,$yank A') + + -- 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 "" (html-file ,dest)) + ,@body + (princ "")))]]) + end) +end) -- cgit