@@ -5464,54 +5464,65 @@ See GH-288."
5464
5464
(should (markdown-table-at-point-p))
5465
5465
(should (= (markdown-table-begin) 2 ))))
5466
5466
5467
- ; ;; Create table with left align
5467
+ ; ;; Extension: pipe table insertion
5468
5468
5469
5469
(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 ) " | | |
5474
5475
|:--|:--|
5475
5476
| | |
5476
5477
| | |
5477
5478
" ))))
5478
5479
5479
- ; ;; Create table with right align
5480
-
5481
5480
(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 ) " | | |
5486
5486
|--:|--:|
5487
5487
| | |
5488
5488
| | |
5489
5489
" ))))
5490
5490
5491
- ; ;; Create table with center align
5492
-
5493
5491
(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 ) " | | |
5498
5508
|---|---|
5499
5509
| | |
5500
5510
| | |
5501
5511
" ))))
5502
5512
5503
- ; ;; Cannot create table
5513
+ ; ;; Create table with center column alignment
5504
5514
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 ."
5507
5517
(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 ) " | | |
5510
5520
|---|---|
5511
5521
| | |
5512
5522
| | |
5513
5523
" ))))
5514
5524
5525
+
5515
5526
; ;; gfm-mode tests:
5516
5527
5517
5528
(ert-deftest test-markdown-gfm/pre-1 ()
0 commit comments