Skip to content

Commit

Permalink
Add an unit test for moving pages
Browse files Browse the repository at this point in the history
  • Loading branch information
syohex committed Nov 20, 2023
1 parent aa7f04d commit 9fb8588
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/yaml-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9fb8588

Please sign in to comment.