[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ea6b4ef 14/79: Increase test documentation.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master ea6b4ef 14/79: Increase test documentation. |
Date: |
Sun, 14 Jun 2015 00:05:18 +0000 |
branch: master
commit ea6b4effc35be81162056366eb7348ecbede1e65
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Increase test documentation.
---
test/context-coloring-test.el | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index b04e90e..67e9009 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -248,6 +248,7 @@ override it."
;;; Assertion functions
(defun context-coloring-test-get-last-message ()
+ "Get the last message in the current messages bufffer."
(let ((messages (split-string
(buffer-substring-no-properties
(point-min)
@@ -317,6 +318,7 @@ override it."
;;; Miscellaneous tests
(defun context-coloring-test-assert-trimmed (result expected)
+ "Assert that RESULT is trimmed like EXPECTED."
(when (not (string-equal result expected))
(ert-fail "Expected string to be trimmed, but it wasn't.")))
@@ -345,6 +347,7 @@ override it."
(setq context-coloring-colorize-hook nil)))
(defmacro context-coloring-test-define-derived-mode (name)
+ "Define a derived mode exclusively for tests."
(let ((name (intern (format "context-coloring-test-%s-mode" name))))
`(define-derived-mode ,name fundamental-mode "Testing")))
@@ -885,21 +888,39 @@ see that function."
face)))))
(defun context-coloring-test-assert-position-comment (position)
+ "Assert that the face at POSITION is a comment."
(context-coloring-test-assert-position-face
position "\\`font-lock-comment\\(-delimiter\\)?-face\\'"))
(defun context-coloring-test-assert-position-constant-comment (position)
+ "Assert that the face at POSITION is a constant comment."
(context-coloring-test-assert-position-face position
'(font-lock-constant-face
font-lock-comment-face)))
(defun context-coloring-test-assert-position-string (position)
+ "Assert that the face at POSITION is a string."
(context-coloring-test-assert-position-face position 'font-lock-string-face))
(defun context-coloring-test-assert-position-nil (position)
+ "Assert that the face at POSITION is nil."
(context-coloring-test-assert-position-face position nil))
(defun context-coloring-test-assert-coloring (map)
- "Assert that the current buffer's coloring matches MAP."
+ "Assert that the current buffer's coloring matches MAP.
+
+MAP's newlines should correspond to the current fixture.
+
+The following characters appearing in MAP assert coloring for
+corresponding points in the fixture:
+
+0-9: Level equals number.
+C: Face is constant comment.
+c: Face is comment.
+n: Face is nil.
+s: Face is string.
+
+Any other characters are discarded. Characters \"x\" and any
+other non-letters are guaranteed to always be discarded."
;; Omit the superfluous, formatting-related leading newline. Can't use
;; `save-excursion' here because if an assertion fails it will cause future
;; tests to get messed up.
@@ -1132,10 +1153,12 @@ ssssssssssss0"))
1111 1 1 1 0 0 000011")))
(defun context-coloring-test-insert-unread-space ()
+ "Simulate the insertion of a space as if by a user."
(setq unread-command-events (cons '(t . 32)
unread-command-events)))
(defun context-coloring-test-remove-faces ()
+ "Remove all faces in the current buffer."
(remove-text-properties (point-min) (point-max) '(face nil)))
(context-coloring-test-deftest-emacs-lisp iteration
- [elpa] master cfcf112 03/79: Add define-deftest macro., (continued)
- [elpa] master cfcf112 03/79: Add define-deftest macro., Jackson Ray Hamilton, 2015/06/13
- [elpa] master ae03324 05/79: Define js and js2 tests simultaneously., Jackson Ray Hamilton, 2015/06/13
- [elpa] master af536a4 07/79: Update coloring assertion syntax., Jackson Ray Hamilton, 2015/06/13
- [elpa] master c1b6b52 06/79: Update function scopes and global tests., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 5e0a0d9 10/79: Newlines., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 23cf7b3 09/79: Refactor derived mode tests., Jackson Ray Hamilton, 2015/06/13
- [elpa] master fd2f2d0 08/79: Refactor remaining js tests., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 1f474d9 11/79: Reorganize functions., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 92166ba 13/79: Add no-fixture option., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 8ea8c9c 15/79: Pass defun test with recursive colorizer., Jackson Ray Hamilton, 2015/06/13
- [elpa] master ea6b4ef 14/79: Increase test documentation.,
Jackson Ray Hamilton <=
- [elpa] master 7975003 18/79: Pass ignored test with recursive colorizer., Jackson Ray Hamilton, 2015/06/13
- [elpa] master d8b5f03 12/79: Remove before-all and after-all., Jackson Ray Hamilton, 2015/06/13
- [elpa] master bc0cb0d 16/79: Pass lambda test with recursive colorizer., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 6090eb3 17/79: Pass quote test with recursive colorizer., Jackson Ray Hamilton, 2015/06/13
- [elpa] master f1ed39f 21/79: Pass comment and string tests with recursive colorizer., Jackson Ray Hamilton, 2015/06/13
- [elpa] master d146af8 23/79: Fix string coloring., Jackson Ray Hamilton, 2015/06/13
- [elpa] master aaf4835 20/79: Remove let-varlist data structure. Cleanup., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 49265ab 25/79: Simplify comment and string parsing., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 52383b5 26/79: Handle octothorpes., Jackson Ray Hamilton, 2015/06/13
- [elpa] master a283883 24/79: Always colorize the remaining region., Jackson Ray Hamilton, 2015/06/13