Przeglądaj źródła

Set up for ert-runner (not working yet)

ert-runner is not working yet because of this issue:
https://github.com/rejeep/ert-runner.el/issues/24
Ryan C. Thompson 9 lat temu
rodzic
commit
0e6a842615
3 zmienionych plików z 84 dodań i 20 usunięć
  1. 9 0
      Cask
  2. 20 20
      test/ido-ubiquitous-test.el
  3. 55 0
      test/test-helper.el

+ 9 - 0
Cask

@@ -0,0 +1,9 @@
+;; -*- mode: emacs-lisp -*-
+
+(source melpa)
+
+(package "ido-ubiquitous" "3.8" "Use ido (nearly) everywhere.")
+
+(development
+ (depends-on "f")
+ (depends-on "ert-runner"))

+ 20 - 20
tests/ido-ubiquitous-test.el → test/ido-ubiquitous-test.el

@@ -30,7 +30,7 @@
 (require 'ido-completing-read+)
 (require 'ido-ubiquitous)
 (require 'ert)
-(require 'cl-macs)
+(require 'cl-lib)
 
 ;; This is a series of macros to facilitate the testing of completion
 ;; non-interactively by simulating input.
@@ -104,10 +104,10 @@ for activation and deactivation."
           ido-cr+-max-items
           ido-cr+-replace-completely))
        (idu-bindings
-        (loop for var in ido-ubiquitous-options collect
-              (list var
-                    (list 'quote
-                          (default-value var))))))
+        (cl-loop for var in ido-ubiquitous-options collect
+                 (list var
+                       (list 'quote
+                             (default-value var))))))
     `(with-mode ido-ubiquitous-mode 1
        (let ,idu-bindings ,@body))))
 
@@ -348,9 +348,9 @@ See `should-with-tag'."
    (string=
     "b"
     (with-simulated-input "b C-j"
-     (ido-completing-read
-      "Prompt: "
-      '("bluebird" "blues" "bluegrass" "blueberry" "yellow ""green") nil t)))))
+      (ido-completing-read
+       "Prompt: "
+       '("bluebird" "blues" "bluegrass" "blueberry" "yellow ""green") nil t)))))
 
 ;; Functions to define overrides on for testing
 (defun idu-no-override-testfunc ()
@@ -432,24 +432,24 @@ See `should-with-tag'."
                    '((enable exact "idu-enabled-testfunc")
                      (disable exact "idu-disabled-testfunc")
                      (enable-old exact "idu-enabled-oldstyle-testfunc"))))
-          (loop for func in
-                '(idu-no-override-testfunc
-                  idu-enabled-testfunc
-                  idu-disabled-testfunc
-                  idu-enabled-oldstyle-testfunc)
-                do (funcall func))
+          (cl-loop for func in
+                   '(idu-no-override-testfunc
+                     idu-enabled-testfunc
+                     idu-disabled-testfunc
+                     idu-enabled-oldstyle-testfunc)
+                   do (funcall func))
           (customize-set-variable
            'ido-ubiquitous-command-overrides
            (append ido-ubiquitous-command-overrides
                    '((enable exact "idu-enabled-testcmd")
                      (disable exact "idu-disabled-testcmd")
                      (enable-old exact "idu-enabled-oldstyle-testcmd"))))
-          (loop for cmd in
-                '(idu-no-override-testcmd
-                  idu-enabled-testcmd
-                  idu-disabled-testcmd
-                  idu-enabled-oldstyle-testcmd)
-                do (call-interactively cmd)))
+          (cl-loop for cmd in
+                   '(idu-no-override-testcmd
+                     idu-enabled-testcmd
+                     idu-disabled-testcmd
+                     idu-enabled-oldstyle-testcmd)
+                   do (call-interactively cmd)))
       (customize-set-variable 'ido-ubiquitous-function-overrides orig-func-overrides)
       (customize-set-variable 'ido-ubiquitous-command-overrides orig-cmd-overrides))))
 

+ 55 - 0
test/test-helper.el

@@ -0,0 +1,55 @@
+;;; test-helper.el ---  -*- lexical-binding: t -*- 
+
+;; Copyright (C) 2015 Ryan C. Thompson
+
+;; Filename: test-helper.el
+;; Author: Ryan C. Thompson
+;; Created: Sat Nov 21 15:27:00 2015 (-0800)
+;; Version: 
+;; Package-Requires: ()
+;; URL: 
+;; Keywords: 
+
+;; This file is NOT part of GNU Emacs.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;;; Commentary: 
+
+;; 
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or (at
+;; your option) any later version.
+;; 
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;; 
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 
+;;; Code:
+
+(require 'f)
+
+(defvar test-path
+  (f-dirname (f-this-file)))
+
+(defvar code-path
+  (f-parent test-path))
+
+(add-to-list 'load-path code-path)
+
+(require 'ido-completing-read+)
+(require 'ido-ubiquitous)
+
+(provide 'test-helper)
+
+;;; test-helper.el ends here