Commit 6d767f96 authored by Artur Malabarba's avatar Artur Malabarba

automated/package-test.el (package-test-get-deps): New test.

parent 2a4a94db
2015-02-03 Artur Malabarba <bruce.connor.am@gmail.com>
* automated/package-test.el (package-test-get-deps): New test.
2015-01-31 Stefan Monnier <monnier@iro.umontreal.ca>
* automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
......
......@@ -73,6 +73,24 @@
:kind 'single)
"Expected `package-desc' parsed from new-pkg-1.0.el.")
(defvar simple-depend-desc-1
(package-desc-create :name 'simple-depend-1
:version '(1 0)
:summary "A single-file package with a dependency."
:kind 'single
:reqs '((simple-depend (1 0))
(multi-file (0 1))))
"`package-desc' used for testing dependencies.")
(defvar simple-depend-desc-2
(package-desc-create :name 'simple-depend-2
:version '(1 0)
:summary "A single-file package with a dependency."
:kind 'single
:reqs '((simple-depend-1 (1 0))
(multi-file (0 1))))
"`package-desc' used for testing dependencies.")
(defvar package-test-data-dir (expand-file-name "data/package" package-test-file-dir)
"Base directory of package test files.")
......@@ -479,6 +497,35 @@ Must called from within a `tar-mode' buffer."
(should (equal archive-contents
(list 1 package-x-test--single-archive-entry-1-4))))))
(ert-deftest package-test-get-deps ()
"Test `package-test-get-deps' with complex structures."
(let ((package-alist
(mapcar (lambda (p) (list (package-desc-name p) p))
(list simple-single-desc
simple-depend-desc
multi-file-desc
new-pkg-desc
simple-depend-desc-1
simple-depend-desc-2))))
(should
(equal (package--get-deps 'simple-depend)
'(simple-single)))
(should
(equal (package--get-deps 'simple-depend 'indirect)
nil))
(should
(equal (package--get-deps 'simple-depend 'direct)
'(simple-single)))
(should
(equal (package--get-deps 'simple-depend-2)
'(simple-depend-1 multi-file simple-depend simple-single)))
(should
(equal (package--get-deps 'simple-depend-2 'indirect)
'(simple-depend multi-file simple-single)))
(should
(equal (package--get-deps 'simple-depend-2 'direct)
'(simple-depend-1 multi-file)))))
(provide 'package-test)
;;; package-test.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment