[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f7f4fe8 126/271: Improve elisp tests.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master f7f4fe8 126/271: Improve elisp tests. |
Date: |
Thu, 05 Feb 2015 18:30:29 +0000 |
branch: master
commit f7f4fe8bb08280201a8e0ce157332702087a61b6
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Improve elisp tests.
---
test/context-coloring-test.el | 32 +++++++++++++++++++++++++++++---
test/fixtures/nested.js | 32 --------------------------------
2 files changed, 29 insertions(+), 35 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index a428dd6..d997d8b 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -20,8 +20,34 @@ FIXTURE."
(context-coloring-mode)
,@body))
-(ert-deftest context-coloring-test-nested ()
- (context-coloring-test-with-fixture "./fixtures/nested.js"
- ))
+(defun context-coloring-test-region-level-p (start end level)
+ (let ((i 0)
+ (length (- end start)))
+ (while (< i length)
+ (let ((point (+ i start)))
+ (should (equal (get-text-property point 'face)
+ (intern-soft (concat "context-coloring-level-"
+ (number-to-string level)
+ "-face")))))
+ (setq i (+ i 1)))))
+
+(ert-deftest context-coloring-test-function-scopes ()
+ (context-coloring-test-with-fixture
+ "./fixtures/function-scopes.js"
+
+ (sleep-for .25) ; Wait for asynchronous coloring to complete.
+
+ (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)
+ (context-coloring-test-region-level-p 25 34 1)
+ (context-coloring-test-region-level-p 34 35 0)
+ (context-coloring-test-region-level-p 35 52 1)
+ (context-coloring-test-region-level-p 52 66 2)
+ (context-coloring-test-region-level-p 66 72 1)
+ (context-coloring-test-region-level-p 72 81 2)
+ (context-coloring-test-region-level-p 81 82 1)
+ (context-coloring-test-region-level-p 82 87 2)
+ (context-coloring-test-region-level-p 87 89 1)))
(provide 'context-coloring-test)
diff --git a/test/fixtures/nested.js b/test/fixtures/nested.js
deleted file mode 100644
index 1621e06..0000000
--- a/test/fixtures/nested.js
+++ /dev/null
@@ -1,32 +0,0 @@
-function a() {
- var A = a;
- function b() {
- var B = b;
- function c() {
- var C = c;
- function d() {
- var D = d;
- function e() {
- var E = e;
- function f() {
- var F = f;
- function g() {
- var G = g;
- function h() {
- var H = [
- A,
- B,
- C,
- D,
- E,
- F,
- G
- ];
- }
- }
- }
- }
- }
- }
- }
-}
- [elpa] master 1c47db9 107/271: Fix link., (continued)
- [elpa] master 1c47db9 107/271: Fix link., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 0960e18 106/271: Spelling., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 79513b2 109/271: Remove styling from faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c6ea2eb 116/271: Add degree sign., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d430804 108/271: Add tty faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d339677 113/271: Strip BOM., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9693c56 125/271: Move fixture into its own file., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e58833f 120/271: Refactor and document., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3031e54 119/271: Extend range; fix modulo bug., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d78046d 098/271: Include external libraries., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f7f4fe8 126/271: Improve elisp tests.,
Jackson Ray Hamilton <=
- [elpa] master fe2bd04 128/271: Multiple vars., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b51c36d 118/271: New experimental color scheme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c595539 111/271: Shift and darken colors for light color scheme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 146c096 114/271: Merge branch 'develop' into feature/color-schemer, Jackson Ray Hamilton, 2015/02/05
- [elpa] master aa5cca3 129/271: Multiple vars. Rename., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fae85f9 117/271: Add code samples., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b190309 133/271: Update documentation to be language-agnostic., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6f34a6a 134/271: Update screenshot., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5a7fc32 138/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f77870d 137/271: Add language support documentation., Jackson Ray Hamilton, 2015/02/05