[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sly 845aac1063 4/7: Per #560: Adjust new tests for sly-pac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sly 845aac1063 4/7: Per #560: Adjust new tests for sly-package-fu.el |
Date: |
Tue, 25 Apr 2023 18:01:37 -0400 (EDT) |
branch: elpa/sly
commit 845aac1063195f6ffcd8064328ee4e8748f23bf0
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Per #560: Adjust new tests for sly-package-fu.el
Instead of strings, use lisp forms, which are easier to read. Make
some tests where :USE subforms aren't present. Use
find-file-noselect. Change name of test.
test/sly-package-fu-tests.el (package-fu-import): Rework.
---
test/sly-package-fu-tests.el | 65 ++++++++++++++++----------------------------
1 file changed, 23 insertions(+), 42 deletions(-)
diff --git a/test/sly-package-fu-tests.el b/test/sly-package-fu-tests.el
index 30205ef3c3..18e20c4db7 100644
--- a/test/sly-package-fu-tests.el
+++ b/test/sly-package-fu-tests.el
@@ -2,53 +2,34 @@
(require 'sly-package-fu "contrib/sly-package-fu")
(require 'sly-tests "lib/sly-tests")
-(def-sly-test sly-package-fu-sly-import (initial-defpackage final-defpackage
symbol)
+(def-sly-test package-fu-import (initial final symbol-to-import)
"Check if importing `import` on `initial-defpackage` results in
`final-defpackage."
- '(("(defpackage :foo
- (:use :cl))
-(in-package :foo)"
- "(defpackage :foo
- (:use :cl)
- (:import-from #:cl
- #:find))
-(in-package :foo)"
- "cl:find")
- ("(defpackage :foo
- (:use :cl)
- (:import-from #:cl
- #:find))
-(in-package :foo)"
- "(defpackage :foo
- (:use :cl)
- (:import-from #:cl
- #:position
- #:find))
-(in-package :foo)"
- "cl:position")
-
- ;; TODO: the output here is incorrect, but we're
- ;; documenting the current behaviour in this test.
- ("(defpackage :foo
- (:use :cl)
- (:import-from #:bknr.datastore-dummy
- #:find))
-(in-package :foo)"
- "(defpackage :foo
- (:use :cl)
- (:import-from #:bknr.datastore-dummy
- #:find)
- (:import-from #:bknr.datastore-dummy
- #:position))
-(in-package :foo)"
- "bknr.datastore-dummy:position"))
+ '((((defpackage :foo) (in-package :foo))
+ ((defpackage :foo (:import-from :cl :find)) (in-package :foo))
+ cl:find)
+ (((defpackage :foo (:import-from :cl :find)) (in-package :foo))
+ ((defpackage :foo (:import-from :cl :position :find)) (in-package :foo))
+ cl:position)
+ (((defpackage :foo (:import-from :bknr.datastore-dummy :find)) (in-package
:foo))
+ ((defpackage :foo (:import-from :bknr.datastore-dummy
+ :position
+ :find))
+ (in-package :foo))
+ bknr.datastore-dummy::position))
(let ((file (make-temp-file "sly-package-fu--fixture")))
(with-temp-buffer
(find-file file)
(lisp-mode)
(setq indent-tabs-mode nil)
- (insert initial-defpackage)
- (sly-package-fu--add-or-update-import-from-form symbol)
- (should (equal final-defpackage
- (buffer-string))))))
+ (dolist (f initial) (insert (pp-to-string f)))
+ ;; FIXME: using internal implementation detail
+ (sly-package-fu--add-or-update-import-from-form
+ (pp-to-string symbol-to-import))
+ (should (equal final
+ (cl-loop initially (goto-char (point-min))
+ for f = (ignore-errors (read (current-buffer)))
+ while f collect f))))))
+
+
(provide 'sly-package-fu-tests)
- [nongnu] elpa/sly updated (07454d5e9c -> fa3bcf0237), ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly fa3bcf0237 7/7: Don't accidentally concatenate symbols in sly-package-fu--insert-symbol, ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly ab90d7dd53 2/7: Unbreak define-sly-ert-test when used M-x compile-defun, ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly 8c7783b729 1/7: Enhance top-level .dir-locals.el, ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly d135442981 5/7: Fix #560: Correctly find :IMPORT-FROM for packages with `.` in name, ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly 6e477e0a53 6/7: Improve form-parsing heuristics of 'sly-import-symbol-at-point', ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly 8b79511b92 3/7: Per #560: Add basic tests for contrib/sly-package-fu.el, ELPA Syncer, 2023/04/25
- [nongnu] elpa/sly 845aac1063 4/7: Per #560: Adjust new tests for sly-package-fu.el,
ELPA Syncer <=