Commit de840e43 authored by Artur Malabarba's avatar Artur Malabarba
Browse files

automated/package-test.el (package-test-sort-by-dependence): New test

parent c03deb4d
2015-02-05 Artur Malabarba <bruce.connor.am@gmail.com>
* automated/package-test.el (package-test-get-deps): Fix typo.
(package-test-sort-by-dependence): New test
2015-02-03 Artur Malabarba <bruce.connor.am@gmail.com>
......
......@@ -526,6 +526,32 @@ Must called from within a `tar-mode' buffer."
(equal (package--get-deps 'simple-depend-2 'direct)
'(simple-depend-1 multi-file)))))
(ert-deftest package-test-sort-by-dependence ()
"Test `package--sort-by-dependence' 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)))
(delete-list
(list simple-single-desc
simple-depend-desc
multi-file-desc
new-pkg-desc
simple-depend-desc-1
simple-depend-desc-2)))
(should
(equal (package--sort-by-dependence delete-list)
(list simple-depend-desc-2 simple-depend-desc-1 new-pkg-desc
multi-file-desc simple-depend-desc simple-single-desc)))
(should
(equal (package--sort-by-dependence (reverse delete-list))
(list new-pkg-desc simple-depend-desc-2 simple-depend-desc-1
multi-file-desc simple-depend-desc simple-single-desc)))))
(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