emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bnf-mode 00a0543 50/74: Removed not used tests macro


From: Stefan Monnier
Subject: [elpa] externals/bnf-mode 00a0543 50/74: Removed not used tests macro
Date: Thu, 9 May 2019 08:27:51 -0400 (EDT)

branch: externals/bnf-mode
commit 00a0543588c740da4875ad219e85855318d342f8
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>

    Removed not used tests macro
---
 test/bnf-mode-font-test.el |  2 +-
 test/test-helper.el        | 42 +++++-------------------------------------
 2 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/test/bnf-mode-font-test.el b/test/bnf-mode-font-test.el
index ff4aa09..58fb1f6 100644
--- a/test/bnf-mode-font-test.el
+++ b/test/bnf-mode-font-test.el
@@ -141,7 +141,7 @@ angle-brackets ::= are-optional"
 
 (ert-deftest bnf-mode-syntax-table/fontify-rule-punctuation ()
   :tags '(fontification syntax-table)
-  (bnf-test-with-temp-buffer"
+  (bnf-test-with-temp-buffer "
 <proper string> ::=
         <any sequence of symbols not containing ` or ' >
         | <empty>"
diff --git a/test/test-helper.el b/test/test-helper.el
index 52cc590..5bbfc83 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -32,17 +32,11 @@
 
 ;;; Code:
 
-(require 'ert-x)          ; `ert-with-test-buffer'
-(require 'cl-lib)         ; `cl-defmacro'
+(require 'cl-lib) ; `cl-defmacro'
 
 ;; Make sure the exact Emacs version can be found in the build output
 (message "Running tests on Emacs %s" emacs-version)
 
-;; The test fixtures assume an indentation width of 4, so we need to set that
-;; up for the tests.
-(setq-default default-tab-width 4
-              indent-tabs-mode nil)
-
 (when (require 'undercover nil t)
   (undercover "bnf-mode.el"))
 
@@ -53,45 +47,19 @@
   ;; Load the file under test
   (load (expand-file-name "bnf-mode" source-directory)))
 
-;; Helpers
-
-(cl-defmacro bnf-deftest (name args &body body)
-  (declare (indent 2))
-  `(ert-deftest ,(intern (format "bnf-ert-%s" name)) ()
-     ""
-     ,@args))
-
-(cl-defmacro bnf-ert-with-test-buffer ((&rest args) initial-contents &body 
body)
-  (declare (indent 2))
-  `(ert-with-test-buffer (,@args)
-     (bnf-mode)
-     (insert ,initial-contents)
-     ,@body))
-
-(defmacro bnf-test-with-temp-buffer (content &rest body)
+(cl-defmacro bnf-test-with-temp-buffer (content &rest body)
   "Evaluate BODY in a temporary buffer with CONTENT."
   (declare (debug t)
            (indent 1))
   `(with-temp-buffer
      (insert ,content)
      (bnf-mode)
-     (font-lock-fontify-buffer)
+     ,(if (fboundp 'font-lock-ensure)
+          '(font-lock-ensure)
+        '(with-no-warnings (font-lock-fontify-buffer)))
      (goto-char (point-min))
      ,@body))
 
-(cl-defmacro bnf-def-indentation-test (name args initial-contents 
expected-output)
-  (declare (indent 2))
-  `(bnf-deftest ,name ,args
-                (bnf-ert-with-test-buffer (:name ,(format "(Expected)" name))
-                                          ,initial-contents
-                                          (let ((indented 
(ert-buffer-string-reindented)))
-                                            (delete-region (point-min) 
(point-max))
-                                            (insert ,expected-output)
-                                            (ert-with-test-buffer (:name 
,(format "(Actual)" name))
-                                              (bnf-mode)
-                                              (insert indented)
-                                              (should (equal indented 
,expected-output)))))))
-
 (defun bnf-test-face-at (pos &optional content)
   "Get the face at POS in CONTENT.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]