Skip to content

Commit 02d68d7

Browse files
committed
Update tests for table insertion
1 parent 782958e commit 02d68d7

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

tests/markdown-test.el

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5464,54 +5464,65 @@ See GH-288."
54645464
(should (markdown-table-at-point-p))
54655465
(should (= (markdown-table-begin) 2))))
54665466

5467-
;;; Create table with left align
5467+
;;; Extension: pipe table insertion
54685468

54695469
(ert-deftest test-markdown-insertion/create-table-with-left-align ()
5470-
"Insert table with left align."
5471-
(markdown-test-string ""
5472-
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 2 RET 2 RET left RET id RET name RET"))
5473-
(should (string-equal (buffer-string) "|id|name|
5470+
"Insert table with left column alignment."
5471+
(markdown-test-string
5472+
""
5473+
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 3 RET 2 RET l RET"))
5474+
(should (string-equal (buffer-string) "| | |
54745475
|:--|:--|
54755476
| | |
54765477
| | |
54775478
"))))
54785479

5479-
;;; Create table with right align
5480-
54815480
(ert-deftest test-markdown-insertion/create-table-with-right-align ()
5482-
"Insert table with right align."
5483-
(markdown-test-string ""
5484-
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 2 RET 2 RET right RET id RET name RET"))
5485-
(should (string-equal (buffer-string) "|id|name|
5481+
"Insert table with right column alignment."
5482+
(markdown-test-string
5483+
""
5484+
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 3 RET 2 RET r RET"))
5485+
(should (string-equal (buffer-string) "| | |
54865486
|--:|--:|
54875487
| | |
54885488
| | |
54895489
"))))
54905490

5491-
;;; Create table with center align
5492-
54935491
(ert-deftest test-markdown-insertion/create-table-with-center-align ()
5494-
"Insert table with center align."
5495-
(markdown-test-string ""
5496-
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 2 RET 2 RET center RET id RET name RET"))
5497-
(should (string-equal (buffer-string) "|id|name|
5492+
"Insert table with center column alignment."
5493+
(markdown-test-string
5494+
""
5495+
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 3 RET 2 RET c RET"))
5496+
(should (string-equal (buffer-string) "| | |
5497+
|:-:|:-:|
5498+
| | |
5499+
| | |
5500+
"))))
5501+
5502+
(ert-deftest test-markdown-insertion/create-table-with-default-align ()
5503+
"Insert table with default column alignment."
5504+
(markdown-test-string
5505+
""
5506+
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 3 RET 2 RET RET"))
5507+
(should (string-equal (buffer-string) "| | |
54985508
|---|---|
54995509
| | |
55005510
| | |
55015511
"))))
55025512

5503-
;;; Cannot create table
5513+
;;; Create table with center column alignment
55045514

5505-
(ert-deftest test-markdown-insertion/cannot-create-table ()
5506-
"Cannot create table."
5515+
(ert-deftest test-markdown-insertion/create-table-with-center-align ()
5516+
"Insert table with center align."
55075517
(markdown-test-string ""
5508-
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 2 RET 2 RET other RET id RET name RET"))
5509-
(should (string-equal (buffer-string) "|id|name|
5518+
(execute-kbd-macro (read-kbd-macro "M-x markdown-insert-table RET 2 RET 3 RET c RET"))
5519+
(should (string-equal (buffer-string) "| | |
55105520
|---|---|
55115521
| | |
55125522
| | |
55135523
"))))
55145524

5525+
55155526
;;; gfm-mode tests:
55165527

55175528
(ert-deftest test-markdown-gfm/pre-1 ()

0 commit comments

Comments
 (0)