Skip to content

Commit f831ff5

Browse files
committed
Add tests for handling of composed characters
1 parent 523f740 commit f831ff5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

evil-tests.el

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,11 @@ and the beginning")
508508
(should (string= (evil-describe 1 2 'exclusive)
509509
"1 character"))
510510
(should (string= (evil-describe 5 2 'exclusive)
511-
"3 characters"))))))
511+
"3 characters")))
512+
(compose-region 9 15 "ϐ") ; visually replaces "buffer" with ϐ
513+
(ert-info ("Adjust range to account for composed characters")
514+
(should (equal (evil-normalize 10 10 'exclusive)
515+
'(9 15 exclusive)))))))
512516

513517
(ert-deftest evil-test-inclusive-type ()
514518
"Expand and contract the `inclusive' type"
@@ -533,7 +537,14 @@ and the beginning")
533537
(should (string= (evil-describe 1 1 'inclusive)
534538
"1 character"))
535539
(should (string= (evil-describe 5 2 'inclusive)
536-
"4 characters")))))
540+
"4 characters")))
541+
(compose-region 9 15 "ϐ") ; visually replaces "buffer" with ϐ
542+
(ert-info ("Don't end in composed characters")
543+
(should (equal (evil-expand 7 12 'inclusive)
544+
'(7 15 inclusive :expanded t))))
545+
(ert-info ("Don't begin in composed characters")
546+
(should (equal (evil-expand 10 20 'inclusive)
547+
'(9 21 inclusive :expanded t))))))
537548

538549
(ert-deftest evil-test-line-type ()
539550
"Expand the `line' type"

0 commit comments

Comments
 (0)