[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 23cf7b3 09/79: Refactor derived mode tests.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 23cf7b3 09/79: Refactor derived mode tests. |
Date: |
Sun, 14 Jun 2015 00:05:15 +0000 |
branch: master
commit 23cf7b35543c926760c5acba77c1f4f774c06aab
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Refactor derived mode tests.
---
test/context-coloring-test.el | 50 +++++++++-------------------------------
1 files changed, 12 insertions(+), 38 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index ebba46d..84b4b08 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -409,25 +409,24 @@ FOREGROUND. Apply ARGUMENTS to
(funcall done)))
(context-coloring-mode))))
-(define-derived-mode
- context-coloring-change-detection-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-change-detection' from
- having any unintentional side-effects on mode support.")
+(defmacro context-coloring-test-define-derived-mode (name)
+ (let ((name (intern (format "context-coloring-test-%s-mode" name))))
+ `(define-derived-mode ,name fundamental-mode "Testing")))
+
+(context-coloring-test-define-derived-mode change-detection)
;; Simply cannot figure out how to trigger an idle timer; would much rather
test
;; that. But (current-idle-time) always returns nil in these tests.
(ert-deftest-async context-coloring-test-change-detection (done)
(context-coloring-define-dispatch
'idle-change
- :modes '(context-coloring-change-detection-mode)
+ :modes '(context-coloring-test-change-detection-mode)
:executable "node"
:command "node test/binaries/noop")
(context-coloring-test-with-fixture-async
"./fixtures/empty"
(lambda (teardown)
- (context-coloring-change-detection-mode)
+ (context-coloring-test-change-detection-mode)
(add-hook
'context-coloring-colorize-hook
(lambda ()
@@ -465,12 +464,7 @@ FOREGROUND. Apply ARGUMENTS to
"Context coloring is not available for this major mode"
"*Messages*")))
-(define-derived-mode
- context-coloring-test-define-dispatch-error-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-define-dispatch-error' from
- having any unintentional side-effects on mode support.")
+(context-coloring-test-define-derived-mode define-dispatch-error)
(ert-deftest context-coloring-test-define-dispatch-error ()
(context-coloring-test-assert-error
@@ -485,12 +479,7 @@ FOREGROUND. Apply ARGUMENTS to
:modes '(context-coloring-test-define-dispatch-error-mode)))
"No colorizer, scopifier or command defined for dispatch"))
-(define-derived-mode
- context-coloring-test-define-dispatch-scopifier-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-define-dispatch-scopifier' from
- having any unintentional side-effects on mode support.")
+(context-coloring-test-define-derived-mode define-dispatch-scopifier)
(ert-deftest context-coloring-test-define-dispatch-scopifier ()
(context-coloring-define-dispatch
@@ -502,12 +491,7 @@ FOREGROUND. Apply ARGUMENTS to
(context-coloring-mode)
(context-coloring-colorize)))
-(define-derived-mode
- context-coloring-test-missing-executable-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-define-dispatch-scopifier' from
- having any unintentional side-effects on mode support.")
+(context-coloring-test-define-derived-mode missing-executable)
(ert-deftest context-coloring-test-missing-executable ()
(context-coloring-define-dispatch
@@ -519,12 +503,7 @@ FOREGROUND. Apply ARGUMENTS to
(context-coloring-test-missing-executable-mode)
(context-coloring-mode)))
-(define-derived-mode
- context-coloring-test-unsupported-version-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-unsupported-version' from
- having any unintentional side-effects on mode support.")
+(context-coloring-test-define-derived-mode unsupported-version)
(ert-deftest-async context-coloring-test-unsupported-version (done)
(context-coloring-define-dispatch
@@ -551,12 +530,7 @@ FOREGROUND. Apply ARGUMENTS to
(funcall done)))
(context-coloring-mode))))
-(define-derived-mode
- context-coloring-test-disable-mode-mode
- fundamental-mode
- "Testing"
- "Prevent `context-coloring-test-disable-mode' from having any
- unintentional side-effects on mode support.")
+(context-coloring-test-define-derived-mode disable-mode)
(ert-deftest-async context-coloring-test-disable-mode (done)
(let (torn-down)
- [elpa] master updated (7df8d42 -> e2f402c), Jackson Ray Hamilton, 2015/06/13
- [elpa] master c337716 01/79: Add statistics., Jackson Ray Hamilton, 2015/06/13
- [elpa] master ac22f0a 02/79: Silence obsolete warnings., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 57e87f0 04/79: Refactor js test definitions., Jackson Ray Hamilton, 2015/06/13
- [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 <=
- [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, 2015/06/13
- [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