From 3139303874dfc3a8c8abe9e98b11479bf64e8e0a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 25 May 2020 16:01:59 -0400 Subject: [PATCH] Remove unused test module This will be replaced soon. --- core/test/helpers.el | 69 ------------------------------------------- core/test/init.el | 18 ----------- core/test/packages.el | 4 --- 3 files changed, 91 deletions(-) delete mode 100644 core/test/helpers.el delete mode 100644 core/test/init.el delete mode 100644 core/test/packages.el diff --git a/core/test/helpers.el b/core/test/helpers.el deleted file mode 100644 index 446ec12d6..000000000 --- a/core/test/helpers.el +++ /dev/null @@ -1,69 +0,0 @@ -;; -*- lexical-binding: t; no-byte-compile: t; -*- -;;; core/test/helpers.el - -(eval-and-compile - (setq doom-interactive-mode 'test) - (doom-initialize 'force 'noerror) - (require 'buttercup) - (setq split-width-threshold 0 - split-height-threshold 0 - window-min-width 0 - window-min-height 0)) - -;; -;;; Buttercup extensions - -(buttercup-define-matcher-for-binary-function :to-equal-file file-equal-p) - -(buttercup-define-matcher :to-expand-into (form expected) - (cl-destructuring-bind (form expected) - (mapcar #'funcall (list form expected)) - (let ((expanded (macroexpand-1 form))) - (if (equal expanded expected) - (cons t (format "Expected `%S' to not expand to `%S'" - form expected)) - (cons nil (format "Expected `%S' to not expand to `%S', but got `%S' instead" - form expected expanded)))))) - -(buttercup-define-matcher :to-output (form &optional expected-output) - (let ((expected-output (and (functionp expected-output) - (funcall expected-output))) - output) - (with-current-buffer (get-buffer "*Messages*") - (let ((standard-output (current-buffer)) - (start (point))) - (let ((inhibit-message t)) - (funcall form)) - (setq output (buffer-substring-no-properties start (point-max))) - (with-silent-modifications (erase-buffer)))) - (cond ((null expected-output) - (if (string-empty-p output) - (cons nil (format "Expected output %S, but got none" - expected-output)) - (cons t (format "Expected no output, but got %S" - output)))) - ((not (equal expected-output output)) - (cons nil (format "Expected output %S, but got %S instead" - expected-output output))) - ((cons t (format "Expected to not get %S as output" - expected-output)))))) - -(buttercup-define-matcher :to-contain-items (items expected) - (cl-destructuring-bind (items expected) - (mapcar #'funcall (list items expected)) - (if-let (missing (cl-set-difference expected items)) - (cons nil (format "Expected list to contain %S, but it was missing %S" - expected missing)) - (cons t (format "Expected list to not contain %S, but it did: %S" - expected items))))) - - -;; -;;; Helper macros - -(defmacro insert!! (&rest text) - "Insert TEXT in buffer, then move cursor to last {0} marker." - `(progn - (insert ,@text) - (when (search-backward "{0}" nil t) - (replace-match "" t t)))) diff --git a/core/test/init.el b/core/test/init.el deleted file mode 100644 index 9c7ea1521..000000000 --- a/core/test/init.el +++ /dev/null @@ -1,18 +0,0 @@ -;;; core/test/init.el -*- lexical-binding: t; no-byte-compile: t; -*- - -;; An init.el for our unit test suites. Do not use this! - -(doom! :completion - company - :ui - doom-dashboard - popup - workspaces - :editor - evil - :tools - pass - ein - :lang - org - web) diff --git a/core/test/packages.el b/core/test/packages.el deleted file mode 100644 index a5f245786..000000000 --- a/core/test/packages.el +++ /dev/null @@ -1,4 +0,0 @@ -;; -*- no-byte-compile: t; -*- -;;; core/test/packages.el - -(package! buttercup)