From abdb02be0a1a58748cc655e39f908b16646e3313 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Mon, 19 Jan 2015 21:00:40 +0100 Subject: [PATCH] Add haskell-indent-tests.el. Add haskell-indent-tests.el, first two tests check haskell-indent-put-region-in-literate. --- tests/haskell-indent-tests.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/haskell-indent-tests.el diff --git a/tests/haskell-indent-tests.el b/tests/haskell-indent-tests.el new file mode 100644 index 000000000..085267229 --- /dev/null +++ b/tests/haskell-indent-tests.el @@ -0,0 +1,23 @@ +(require 'ert) +(require 'haskell-indent) +(require 'haskell-mode) + + + +;; haskell-indent-put-region-in-literate happens to be in haskell-indent +;; when the function is moved, move the tests also +(ert-deftest haskell-indent-put-region-in-literate-1 () + (should (equal "> literate" + (with-temp-buffer + (insert "literate") + (literate-haskell-mode) + (haskell-indent-put-region-in-literate (point-min) (point-max)) + (buffer-substring-no-properties (point-min) (point-max)))))) + +(ert-deftest haskell-indent-put-region-in-literate-2 () + (should (equal "literate" + (with-temp-buffer + (insert "> literate") + (literate-haskell-mode) + (haskell-indent-put-region-in-literate (point-min) (point-max) -1) + (buffer-substring-no-properties (point-min) (point-max))))))