[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fd5b9e1 05/28: Add tests for versions and disabling.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master fd5b9e1 05/28: Add tests for versions and disabling. |
Date: |
Tue, 05 May 2015 11:10:16 +0000 |
branch: master
commit fd5b9e16f82ff0689630556eeba702c54d46abf0
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Add tests for versions and disabling.
---
test/binaries/noop | 5 +++++
test/context-coloring-test.el | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/test/binaries/noop b/test/binaries/noop
new file mode 100644
index 0000000..a35b551
--- /dev/null
+++ b/test/binaries/noop
@@ -0,0 +1,5 @@
+#!/usr/bin/env node
+
+'use strict';
+
+console.log(JSON.stringify([]));
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index cbd2002..333a3f3 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -303,6 +303,12 @@ FOREGROUND. Apply ARGUMENTS to
;;; The tests
+(ert-deftest context-coloring-test-check-version ()
+ (when (not (context-coloring-check-version "2.1.3" "3.0.1"))
+ (ert-fail "Expected version 3.0.1 to satisfy 2.1.3, but it didn't."))
+ (when (context-coloring-check-version "3.0.1" "2.1.3")
+ (ert-fail "Expected version 2.1.3 not to satisfy 3.0.1, but it did.")))
+
(ert-deftest context-coloring-test-unsupported-mode ()
(context-coloring-test-with-fixture
"./fixtures/function-scopes.js"
@@ -343,6 +349,35 @@ 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.")
+
+(ert-deftest-async context-coloring-test-disable-mode (done)
+ (let (torn-down)
+ (context-coloring-define-dispatch
+ 'disable-mode
+ :modes '(context-coloring-test-disable-mode-mode)
+ :executable "node"
+ :command "node test/binaries/noop"
+ :teardown (lambda ()
+ (setq torn-down t)))
+ (context-coloring-test-with-fixture-async
+ "./fixtures/function-scopes.js"
+ (lambda (teardown)
+ (unwind-protect
+ (progn
+ (context-coloring-test-disable-mode-mode)
+ (context-coloring-mode)
+ (context-coloring-mode -1)
+ (when (not torn-down)
+ (ert-fail "Expected teardown function to have been called, but
it wasn't.")))
+ (funcall teardown))
+ (funcall done)))))
+
(defvar context-coloring-test-theme-index 0
"Unique index for unique theme names.")
- [elpa] master updated (510f0ff -> 8a083d5), Jackson Ray Hamilton, 2015/05/05
- [elpa] master f9a6dce 03/28: Coveralls, Jackson Ray Hamilton, 2015/05/05
- [elpa] master 7a9bd8d 07/28: Add async mode startup test., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 2efebc8 10/28: Don't colorize if there are parse errors., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 30f9b0a 02/28: Update Cask file., Jackson Ray Hamilton, 2015/05/05
- [elpa] master fd5b9e1 05/28: Add tests for versions and disabling.,
Jackson Ray Hamilton <=
- [elpa] master 85ff3ef 13/28: Trailing whitespace, empty arrays, empty strings., Jackson Ray Hamilton, 2015/05/05
- [elpa] master f11f97f 09/28: Make default colors more like font-lock's., Jackson Ray Hamilton, 2015/05/05
- [elpa] master a7f5970 04/28: Remove unused function., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 9873030 08/28: Use real keywords., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 0888e06 01/28: Use Cask and Coveralls., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 202ca74 15/28: Drop `subr-x' dependency., Jackson Ray Hamilton, 2015/05/05
- [elpa] master dd3fe3c 06/28: Fix badges., Jackson Ray Hamilton, 2015/05/05
- [elpa] master fb53884 17/28: Update README., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 52da59c 18/28: Bust cache., Jackson Ray Hamilton, 2015/05/05
- [elpa] master 3f63fab 11/28: Add local coverage configuration., Jackson Ray Hamilton, 2015/05/05