From 3d438363976569ba75dbf2c7182a797ae0387471 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Mon, 11 Dec 2017 12:28:39 -0500 Subject: [PATCH] Add tests for GFM simplified tables at beginning of buffer See GH-298 --- tests/markdown-test.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/markdown-test.el b/tests/markdown-test.el index 19f719b..11f4338 100644 --- a/tests/markdown-test.el +++ b/tests/markdown-test.el @@ -5460,6 +5460,30 @@ See GH-288." (markdown-test-range-has-face 24 26 'markdown-pre-face) (markdown-test-range-has-face 28 30 'markdown-markup-face))) +;;; Extension: GFM simplified tables + +(ert-deftest test-markdown-gfm/false-table-first-line () + "Test beginning of table detection at beginning of buffer. +Based on GH-298." + (markdown-test-string + "[|" + (should-not (gfm--table-at-point-p)))) + +(ert-deftest test-markdown-gfm/true-table-first-line () + "Test beginning of table detection at beginning of buffer." + (markdown-test-string + "[| +-|- +x|" + (dotimes (x 3) + (should (gfm--table-at-point-p)) + (forward-line)))) + +(ert-deftest test-markdown-gfm/table-begin-top-of-file () + "Test beginning of table detection at top of file." + (markdown-test-string "[|" + (should-not (gfm--table-at-point-p)))) + ;;; Tests for other extensions: (ert-deftest test-markdown-ext/pandoc-fancy-lists () -- 2.11.4.GIT