emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/yaml-mode 9fb85886cc 1/2: Add an unit test for moving page


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 9fb85886cc 1/2: Add an unit test for moving pages
Date: Tue, 21 Nov 2023 22:00:48 -0500 (EST)

branch: elpa/yaml-mode
commit 9fb85886cc86e2b2a3d21981e51a57326e1f2d91
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: Shohei YOSHIDA <syohex@gmail.com>

    Add an unit test for moving pages
---
 test/yaml-mode-test.el | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/yaml-mode-test.el b/test/yaml-mode-test.el
index 0ea659c027..43f75477c0 100644
--- a/test/yaml-mode-test.el
+++ b/test/yaml-mode-test.el
@@ -174,6 +174,30 @@ Detail: https://github.com/yoshiki/yaml-mode/issues/96";
       font-lock-constant-face
       nil)))
 
+(ert-deftest moving/page-navigation ()
+  "Moving page by page delimiters.
+Detail: https://github.com/yoshiki/yaml-mode/pull/110";
+  (yaml-test-string "
+---
+at: 2001-08-12 09:25:00.00 Z
+type: GET
+HTTP: '1.0'
+url: '/index.html'
+--- %YAML:1.0
+at: 2001-08-12 09:25:10.00 Z
+type: GET
+HTTP: '1.0'
+url: '/toc.html'
+"
+    ;; NOTE forward-page/backward behavior is different between older Emacs(< 
28) and newer ones
+    ;; when the cursor is on the page delimiter
+    (forward-page)
+    (should (= (line-number-at-pos) 3))
+    (forward-page)
+    (should (= (line-number-at-pos) 8))
+    (backward-page)
+    (should (= (line-number-at-pos) 3))))
+
 (provide 'yaml-mode-test)
 
 ;;; yaml-mode-test.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]