Browse Source

Add tests for tag width calculation

* testing/lisp/test-org.el (test-org/tag-align): New test.
Yasushi SHOJI 8 years ago
parent
commit
5111c3a5fa
1 changed files with 22 additions and 0 deletions
  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