[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1d9cf42 164/271: Refactor tests.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 1d9cf42 164/271: Refactor tests. |
Date: |
Thu, 05 Feb 2015 18:30:50 +0000 |
branch: master
commit 1d9cf427aee1b2ac8042232ee1aac564bd7ce6f4
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Refactor tests.
---
test/context-coloring-test.el | 41 +++++++++++++++++++----------------------
1 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index 0609f37..dcd40e0 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -19,14 +19,22 @@ FIXTURE."
(insert (context-coloring-test-read-file ,fixture))
,@body))
-(defmacro context-coloring-test-js2-with-fixture (fixture &rest body)
- "Evaluate BODY in a temporary buffer with the relative
-FIXTURE."
+(defmacro context-coloring-test-js-with-fixture (fixture &rest body)
+ `(context-coloring-test-with-fixture
+ ,fixture
+ (js-mode)
+ (context-coloring-mode)
+ (sleep-for .25) ; Wait for asynchronous coloring.
+ ,@body))
+
+(defmacro context-coloring-test-js2-mode-with-fixture (fixture &rest body)
`(context-coloring-test-with-fixture
,fixture
(require 'js2-mode)
(setq js2-mode-show-parse-errors nil)
(setq js2-mode-show-strict-warnings nil)
+ (js2-mode)
+ (context-coloring-mode)
,@body))
(defun context-coloring-test-region-level-p (start end level)
@@ -53,7 +61,7 @@ FIXTURE."
(context-coloring-test-message-should-be
"Context coloring is not available for this major mode")))
-(defun context-coloring-test-function-scopes ()
+(defun context-coloring-test-js-function-scopes ()
(context-coloring-test-region-level-p 1 9 0)
(context-coloring-test-region-level-p 9 23 1)
(context-coloring-test-region-level-p 23 25 0)
@@ -68,41 +76,30 @@ FIXTURE."
(context-coloring-test-region-level-p 87 89 1))
(ert-deftest context-coloring-test-js-mode-function-scopes ()
- (context-coloring-test-with-fixture
+ (context-coloring-test-js-with-fixture
"./fixtures/function-scopes.js"
- (js-mode)
- (context-coloring-mode)
- (sleep-for .25) ; Wait for asynchronous coloring.
- (context-coloring-test-function-scopes)))
+ (context-coloring-test-js-function-scopes)))
(ert-deftest context-coloring-test-js2-mode-function-scopes ()
- (context-coloring-test-js2-with-fixture
+ (context-coloring-test-js2-mode-with-fixture
"./fixtures/function-scopes.js"
- (js2-mode)
- (context-coloring-mode)
- (context-coloring-test-function-scopes)))
+ (context-coloring-test-js-function-scopes)))
(ert-deftest context-coloring-test-js2-mode-global ()
- (context-coloring-test-js2-with-fixture
+ (context-coloring-test-js2-mode-with-fixture
"./fixtures/global.js"
- (js2-mode)
- (context-coloring-mode)
(context-coloring-test-region-level-p 20 28 1)
(context-coloring-test-region-level-p 28 35 0)
(context-coloring-test-region-level-p 35 41 1)))
(ert-deftest context-coloring-test-js2-mode-block-scopes ()
- (context-coloring-test-js2-with-fixture
+ (context-coloring-test-js2-mode-with-fixture
"./fixtures/block-scopes.js"
- (js2-mode)
- (context-coloring-mode)
(context-coloring-test-region-level-p 1 10 0)))
(ert-deftest context-coloring-test-js2-mode-catch ()
- (context-coloring-test-js2-with-fixture
+ (context-coloring-test-js2-mode-with-fixture
"./fixtures/catch.js"
- (js2-mode)
- (context-coloring-mode)
(context-coloring-test-region-level-p 20 27 1)
(context-coloring-test-region-level-p 27 51 2)
(context-coloring-test-region-level-p 51 52 1)
- [elpa] master 76122df 144/271: Write js2 scopifier., (continued)
- [elpa] master 76122df 144/271: Write js2 scopifier., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5fcd757 146/271: Refactor to use more resilient dispatch strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8982c75 127/271: Merge branch 'feature/tests' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master e06fbe9 158/271: Add comment support for js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a2b6a5a 112/271: Use defvar-local., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6c8175e 153/271: Update compilation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4f57f0c 163/271: Improve global test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master dc8e99c 130/271: Function name., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 2bb4d12 124/271: More cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d301048 154/271: Update compilation again., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1d9cf42 164/271: Refactor tests.,
Jackson Ray Hamilton <=
- [elpa] master a0ccc5c 162/271: Improve and pass catch test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c8fa33f 170/271: Improve async benchmarking., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7954efc 110/271: Rename instances of depth to level., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 338716d 161/271: Refactor., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fc81cf9 157/271: Don't use timers for js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b4c220a 159/271: Always remove hooks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e040ca0 181/271: Just use stable emacs., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e7ee77 155/271: Add catch test. Don't uncolorize., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 665a54a 167/271: Add more js-mode tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43f2e3b 168/271: Increase reliability of async tests., Jackson Ray Hamilton, 2015/02/05