|
3 | 3 | ;; Author: Mats Lidell <matsl@gnu.org> |
4 | 4 | ;; |
5 | 5 | ;; Orig-Date: 18-May-21 at 22:14:10 |
6 | | -;; Last-Mod: 20-Jan-26 at 00:21:25 by Mats Lidell |
| 6 | +;; Last-Mod: 12-Apr-26 at 11:24:18 by Bob Weiner |
7 | 7 | ;; |
8 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later |
9 | 9 | ;; |
|
461 | 461 |
|
462 | 462 | (ert-deftest kotl-mode-split-cell () |
463 | 463 | "Kotl-mode split cell." |
464 | | - :expected-result :failed |
465 | 464 | (let ((kotl-file (make-temp-file "hypb" nil ".kotl"))) |
466 | 465 | (unwind-protect |
467 | 466 | (with-current-buffer (find-file kotl-file) |
| 467 | + (ert-info ("Split before second line; remove all whitespace at split") |
| 468 | + (insert "first \t") |
| 469 | + (kotl-mode:newline 1) |
| 470 | + (insert " \tsecond") |
| 471 | + (kotl-mode:beginning-of-line) |
| 472 | + (kotl-mode:split-cell) |
| 473 | + (should (= (line-number-at-pos) 3)) |
| 474 | + (should (string= (kcell-view:contents) "second")) |
| 475 | + (kotl-mode:previous-cell 1) |
| 476 | + (should (string= (kcell-view:contents) "first"))) |
468 | 477 | (ert-info ("Split on first line") |
469 | | - (insert "firstsecond\n") |
470 | | - (backward-char 7) |
| 478 | + (kotl-mode:kill-tree 0) |
| 479 | + (insert "firstsecond") |
| 480 | + (backward-char 6) |
471 | 481 | (kotl-mode:split-cell) |
472 | 482 | (should (string= (kcell-view:label (point)) "2")) |
473 | 483 | (kotl-mode:demote-tree 0) |
|
481 | 491 | (kotl-mode:previous-line 1) |
482 | 492 | (kotl-mode:end-of-line) |
483 | 493 | (kotl-mode:split-cell) |
484 | | - (should (= (line-number-at-pos) 3))) |
485 | | - (ert-info ("Split before second line") |
486 | | - (kotl-mode:kill-tree 0) |
487 | | - (insert "first") |
488 | | - (kotl-mode:newline 1) |
489 | | - (insert "second") |
490 | | - (kotl-mode:beginning-of-line) |
491 | | - (kotl-mode:split-cell) |
492 | 494 | (should (= (line-number-at-pos) 3)))) |
493 | 495 | (hy-delete-file-and-buffer kotl-file)))) |
494 | 496 |
|
|
0 commit comments