소스 검색

Add tests for tag width calculation

* testing/lisp/test-org.el (test-org/tag-align): New test.
Yasushi SHOJI 9 년 전
부모
커밋
5111c3a5fa
1개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 22 0
      testing/lisp/test-org.el

+ 22 - 0
testing/lisp/test-org.el

@@ -4131,6 +4131,28 @@ Paragraph<point>"
       (org-test-with-temp-text "* H\nA\n* H2\nA"
 	(org-occur "A" nil (lambda () (equal (org-get-heading) "H2")))))))
 
+
+;;; Tags
+
+(ert-deftest test-org/tag-align ()
+  "Test `org-align-tags-here' with different display width."
+  (should
+   ;;      12345678901234567890
+   (equal "* Test         :abc:"
+	  (org-test-with-temp-text "* Test :abc:"
+	    (let ((org-tags-column -20)
+		  (indent-tabs-mode nil))
+	     (org-fix-tags-on-the-fly))
+	    (buffer-string))))
+  (should
+   ;;      12345678901234567890
+   (equal "* Test      :日本語:"
+	  (org-test-with-temp-text "* Test :日本語:"
+	    (let ((org-tags-column -20)
+		  (indent-tabs-mode nil))
+	     (org-fix-tags-on-the-fly))
+	    (buffer-string)))))
+
 
 ;;; Timestamps API