[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a193f4e 08/16: Refactor position level assertion.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master a193f4e 08/16: Refactor position level assertion. |
Date: |
Sun, 18 Oct 2015 11:21:44 +0000 |
branch: master
commit a193f4e870a1c0a66a4ddd2ad79d3998f40330c8
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Refactor position level assertion.
---
test/context-coloring-test.el | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index e267941..c8574da 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -365,21 +365,21 @@ signaled."
;;; Coloring tests
+(defun context-coloring-test-face-to-level (face)
+ "Convert FACE symbol to its corresponding level, or nil."
+ (when face
+ (let* ((face-string (symbol-name face))
+ (matches (string-match
+ context-coloring-level-face-regexp
+ face-string)))
+ (when matches
+ (string-to-number (match-string 1 face-string))))))
+
(defun context-coloring-test-assert-position-level (position level)
"Assert that POSITION has LEVEL."
- (let ((face (get-text-property position 'face))
- actual-level)
- (when (not (and face
- (let* ((face-string (symbol-name face))
- (matches (string-match
- context-coloring-level-face-regexp
- face-string)))
- (when matches
- (setq actual-level (string-to-number
- (substring face-string
- (match-beginning 1)
- (match-end 1))))
- (= level actual-level)))))
+ (let* ((face (get-text-property position 'face))
+ (actual-level (context-coloring-test-face-to-level face)))
+ (when (not (= level actual-level))
(ert-fail (format (concat "Expected level at position %s, "
"which is \"%s\", to be %s; "
"but it was %s")
- [elpa] master updated (9319a95 -> 6934762), Jackson Ray Hamilton, 2015/10/18
- [elpa] master 53279b1 01/16: Fix tests on Windows., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 85397da 02/16: Add more sophisticated block scope test., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 683a522 04/16: Suggest eval-expression-minibuffer-setup-hook., Jackson Ray Hamilton, 2015/10/18
- [elpa] master df914b8 03/16: Bump minimum js2-mode version., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 7c16f46 05/16: Add initial level setting., Jackson Ray Hamilton, 2015/10/18
- [elpa] master fa99117 06/16: Add defcustom types., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 614de4c 07/16: Don't make the initial level buffer-local., Jackson Ray Hamilton, 2015/10/18
- [elpa] master a193f4e 08/16: Refactor position level assertion.,
Jackson Ray Hamilton <=
- [elpa] master 6fe9e58 09/16: Add Node.js detection., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 6531b86 11/16: Use more agnostic names., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 2c62db1 10/16: Ensure Node.js variable is global., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 6ac3b43 12/16: Merge branch 'detect-node', Jackson Ray Hamilton, 2015/10/18
- [elpa] master ff9643c 14/16: Update Zenburn paragraph., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 765d4c4 13/16: Document new scope detection., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 0c3a48f 15/16: Version 7.1.0., Jackson Ray Hamilton, 2015/10/18
- [elpa] master 6934762 16/16: Merge commit '0c3a48f05d17f486a0c522f0f9ec316dce24d86d' from context-coloring, Jackson Ray Hamilton, 2015/10/18