aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Petton2017-06-19 14:43:39 +0200
committerNicolas Petton2017-06-19 14:43:39 +0200
commitb2fcba448486ced5c75e666a0ce964aebccf4aa5 (patch)
tree6d909fa5045e30406ff3c9c3cb8527d3f6a94de1 /test
parentae98cdf9431604d0f722f1db217ca06debfbb7b6 (diff)
downloademacs-b2fcba448486ced5c75e666a0ce964aebccf4aa5.tar.gz
emacs-b2fcba448486ced5c75e666a0ce964aebccf4aa5.zip
Revert "Add current-line in simple.el"
This reverts commit ae98cdf9431604d0f722f1db217ca06debfbb7b6.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/simple-tests.el49
1 files changed, 0 insertions, 49 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index ad7aee1db17..180dcc0a209 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -448,54 +448,5 @@ See Bug#21722."
448 (call-interactively #'eval-expression) 448 (call-interactively #'eval-expression)
449 (should (equal (current-message) "66 (#o102, #x42, ?B)")))))) 449 (should (equal (current-message) "66 (#o102, #x42, ?B)"))))))
450 450
451(ert-deftest line-number-at-pos-in-widen-buffer ()
452 (let ((target-line 3))
453 (with-temp-buffer
454 (insert "a\nb\nc\nd\n")
455 (goto-char (point-min))
456 (forward-line (1- target-line))
457 (should (equal (line-number-at-pos) target-line))
458 (should (equal (line-number-at-pos nil t) target-line)))))
459
460(ert-deftest line-number-at-pos-in-narrow-buffer ()
461 (let ((target-line 3))
462 (with-temp-buffer
463 (insert "a\nb\nc\nd\n")
464 (goto-char (point-min))
465 (forward-line (1- target-line))
466 (narrow-to-region (line-beginning-position) (line-end-position))
467 (should (equal (line-number-at-pos) 1))
468 (should (equal (line-number-at-pos nil t) target-line)))))
469
470(ert-deftest line-number-at-pos-keeps-restriction ()
471 (with-temp-buffer
472 (insert "a\nb\nc\nd\n")
473 (goto-char (point-min))
474 (forward-line 2)
475 (narrow-to-region (line-beginning-position) (line-end-position))
476 (should (equal (line-number-at-pos) 1))
477 (line-number-at-pos nil t)
478 (should (equal (line-number-at-pos) 1))))
479
480(ert-deftest line-number-at-pos-keeps-point ()
481 (let (pos)
482 (with-temp-buffer
483 (insert "a\nb\nc\nd\n")
484 (goto-char (point-min))
485 (forward-line 2)
486 (setq pos (point))
487 (line-number-at-pos)
488 (line-number-at-pos nil t)
489 (should (equal pos (point))))))
490
491(ert-deftest line-number-at-pos-when-passing-point ()
492 (let (pos)
493 (with-temp-buffer
494 (insert "a\nb\nc\nd\n")
495 (should (equal (line-number-at-pos 1) 1))
496 (should (equal (line-number-at-pos 3) 2))
497 (should (equal (line-number-at-pos 5) 3))
498 (should (equal (line-number-at-pos 7) 4)))))
499
500(provide 'simple-test) 451(provide 'simple-test)
501;;; simple-test.el ends here 452;;; simple-test.el ends here