瀏覽代碼

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