aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2013-09-29 22:41:00 +0300
committerDmitry Gutov2013-09-29 22:41:00 +0300
commit056453c62ebfdcea2764fdaba09a89d0e533ec1d (patch)
treee17e4104053c09fada02b1a236f7938f51812bfa /test
parent832966e57f6290e09bb5b477f4d947df53c230d0 (diff)
downloademacs-056453c62ebfdcea2764fdaba09a89d0e533ec1d.tar.gz
emacs-056453c62ebfdcea2764fdaba09a89d0e533ec1d.zip
* lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): Pass
`extras' slot from `package-desc' to `package-make-ac-desc'. * lisp/emacs-lisp/package.el (package-desc-from-define): Accept additional arguments as plist, convert it to an alist and store it in the `extras' slot. (package-generate-description-file): Convert extras alist back to plist and append to the `define-package' form arguments. (package--alist-to-plist): New function. (package--ac-desc): Add `extras' slot. (package--add-to-archive-contents): Check if the archive-contents vector is long enough, and if it is, pass its `extras' slot value to `package-desc-create'. (package-buffer-info): Call `lm-homepage', pass the returned value to `package-desc-from-define'. (describe-package-1): Render the homepage button. * test/automated/package-test.el (simple-single-desc-1-4): Remove, it was unused. (simple-single-desc): Expect :homepage property. (multi-file-desc): Same. (with-package-test): Do not save previous `default-directory' value, let-bind the var instead. (package-test-install-single): Expect :homepage property in the generated pkg file. (package-test-describe-package): Expect Homepage button. (package-test-describe-non-installed-package) (package-test-describe-non-installed-multi-file-package): Same. (package-test-describe-not-installed-package): Remove, it was a duplicate. * test/automated/package-x-test.el (package-x-test--single-archive-entry-1-3): Expect :homepage property. (package-x-test--single-archive-entry-1-4): Expect nil extras slot. * test/automated/data/package/archive-contents: Add :homepage properties to `simple-single' and `multi-file'. * test/automated/data/package/simple-single-1.3.el: Add URL header. Fixes: debbugs:13291
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog26
-rw-r--r--test/automated/data/package/archive-contents6
-rw-r--r--test/automated/data/package/multi-file-0.2.3.tarbin20480 -> 20480 bytes
-rw-r--r--test/automated/data/package/simple-single-1.3.el1
-rw-r--r--test/automated/package-test.el37
-rw-r--r--test/automated/package-x-test.el6
6 files changed, 47 insertions, 29 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index c8785ab4fec..3f115d9e4e8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,29 @@
12013-09-29 Dmitry Gutov <dgutov@yandex.ru>
2
3 * automated/package-test.el (simple-single-desc-1-4): Remove, it
4 was unused.
5 (simple-single-desc): Expect :homepage property.
6 (multi-file-desc): Same.
7 (with-package-test): Do not save previous `default-directory'
8 value, let-bind the var instead.
9 (package-test-install-single): Expect :homepage property in the
10 generated pkg file.
11 (package-test-describe-package): Expect Homepage button.
12 (package-test-describe-non-installed-package)
13 (package-test-describe-non-installed-multi-file-package): Same.
14 (package-test-describe-not-installed-package): Remove, it was a
15 duplicate.
16
17 * automated/package-x-test.el
18 (package-x-test--single-archive-entry-1-3): Expect :homepage
19 property.
20 (package-x-test--single-archive-entry-1-4): Expect nil extras slot.
21
22 * automated/data/package/simple-single-1.3.el: Add URL header.
23
24 * automated/data/package/archive-contents: Add :homepage
25 properties to `simple-single' and `multi-file'.
26
12013-09-22 Daniel Colascione <dancol@dancol.org> 272013-09-22 Daniel Colascione <dancol@dancol.org>
2 28
3 * automated/data-test.el: 29 * automated/data-test.el:
diff --git a/test/automated/data/package/archive-contents b/test/automated/data/package/archive-contents
index 7e4a410030f..b26179c0c3b 100644
--- a/test/automated/data/package/archive-contents
+++ b/test/automated/data/package/archive-contents
@@ -1,10 +1,12 @@
1(1 1(1
2 (simple-single . 2 (simple-single .
3 [(1 3) 3 [(1 3)
4 nil "A single-file package with no dependencies" single]) 4 nil "A single-file package with no dependencies" single
5 ((:homepage . "http://doodles.au"))])
5 (simple-depend . 6 (simple-depend .
6 [(1 0) 7 [(1 0)
7 ((simple-single (1 3))) "A single-file package with a dependency." single]) 8 ((simple-single (1 3))) "A single-file package with a dependency." single])
8 (multi-file . 9 (multi-file .
9 [(0 2 3) 10 [(0 2 3)
10 nil "Example of a multi-file tar package" tar])) 11 nil "Example of a multi-file tar package" tar
12 ((:homepage . "http://puddles.li"))]))
diff --git a/test/automated/data/package/multi-file-0.2.3.tar b/test/automated/data/package/multi-file-0.2.3.tar
index bdbbab0e6f4..dde331d0e01 100644
--- a/test/automated/data/package/multi-file-0.2.3.tar
+++ b/test/automated/data/package/multi-file-0.2.3.tar
Binary files differ
diff --git a/test/automated/data/package/simple-single-1.3.el b/test/automated/data/package/simple-single-1.3.el
index a61784164f8..6756a28080b 100644
--- a/test/automated/data/package/simple-single-1.3.el
+++ b/test/automated/data/package/simple-single-1.3.el
@@ -3,6 +3,7 @@
3;; Author: J. R. Hacker <jrh@example.com> 3;; Author: J. R. Hacker <jrh@example.com>
4;; Version: 1.3 4;; Version: 1.3
5;; Keywords: frobnicate 5;; Keywords: frobnicate
6;; URL: http://doodles.au
6 7
7;;; Commentary: 8;;; Commentary:
8 9
diff --git a/test/automated/package-test.el b/test/automated/package-test.el
index 799009063e1..b5235ee99a9 100644
--- a/test/automated/package-test.el
+++ b/test/automated/package-test.el
@@ -47,16 +47,10 @@
47 (package-desc-create :name 'simple-single 47 (package-desc-create :name 'simple-single
48 :version '(1 3) 48 :version '(1 3)
49 :summary "A single-file package with no dependencies" 49 :summary "A single-file package with no dependencies"
50 :kind 'single) 50 :kind 'single
51 :extras '((:homepage . "http://doodles.au")))
51 "Expected `package-desc' parsed from simple-single-1.3.el.") 52 "Expected `package-desc' parsed from simple-single-1.3.el.")
52 53
53(defvar simple-single-desc-1-4
54 (package-desc-create :name 'simple-single
55 :version '(1 4)
56 :summary "A single-file package with no dependencies"
57 :kind 'single)
58 "Expected `package-desc' parsed from simple-single-1.4.el.")
59
60(defvar simple-depend-desc 54(defvar simple-depend-desc
61 (package-desc-create :name 'simple-depend 55 (package-desc-create :name 'simple-depend
62 :version '(1 0) 56 :version '(1 0)
@@ -69,7 +63,8 @@
69 (package-desc-create :name 'multi-file 63 (package-desc-create :name 'multi-file
70 :version '(0 2 3) 64 :version '(0 2 3)
71 :summary "Example of a multi-file tar package" 65 :summary "Example of a multi-file tar package"
72 :kind 'tar) 66 :kind 'tar
67 :extras '((:homepage . "http://puddles.li")))
73 "Expected `package-desc' from \"multi-file-0.2.3.tar\".") 68 "Expected `package-desc' from \"multi-file-0.2.3.tar\".")
74 69
75(defvar new-pkg-desc 70(defvar new-pkg-desc
@@ -97,7 +92,7 @@
97 (package-user-dir package-test-user-dir) 92 (package-user-dir package-test-user-dir)
98 (package-archives `(("gnu" . ,package-test-data-dir))) 93 (package-archives `(("gnu" . ,package-test-data-dir)))
99 (old-yes-no-defn (symbol-function 'yes-or-no-p)) 94 (old-yes-no-defn (symbol-function 'yes-or-no-p))
100 (old-pwd default-directory) 95 (default-directory package-test-file-dir)
101 package--initialized 96 package--initialized
102 package-alist 97 package-alist
103 ,@(if update-news 98 ,@(if update-news
@@ -128,8 +123,7 @@
128 (when (and (boundp 'package-test-archive-upload-base) 123 (when (and (boundp 'package-test-archive-upload-base)
129 (file-directory-p package-test-archive-upload-base)) 124 (file-directory-p package-test-archive-upload-base))
130 (delete-directory package-test-archive-upload-base t)) 125 (delete-directory package-test-archive-upload-base t))
131 (setf (symbol-function 'yes-or-no-p) old-yes-no-defn) 126 (setf (symbol-function 'yes-or-no-p) old-yes-no-defn))))
132 (cd old-pwd))))
133 127
134(defmacro with-fake-help-buffer (&rest body) 128(defmacro with-fake-help-buffer (&rest body)
135 "Execute BODY in a temp buffer which is treated as the \"*Help*\" buffer." 129 "Execute BODY in a temp buffer which is treated as the \"*Help*\" buffer."
@@ -194,7 +188,9 @@ Must called from within a `tar-mode' buffer."
194 (should (string= (buffer-string) 188 (should (string= (buffer-string)
195 (concat "(define-package \"simple-single\" \"1.3\" " 189 (concat "(define-package \"simple-single\" \"1.3\" "
196 "\"A single-file package " 190 "\"A single-file package "
197 "with no dependencies\" 'nil)\n")))) 191 "with no dependencies\" 'nil "
192 ":homepage \"http://doodles.au\""
193 ")\n"))))
198 (should (file-exists-p autoloads-file)) 194 (should (file-exists-p autoloads-file))
199 (should-not (get-file-buffer autoloads-file))))) 195 (should-not (get-file-buffer autoloads-file)))))
200 196
@@ -319,23 +315,12 @@ Must called from within a `tar-mode' buffer."
319 (should (search-forward "Version: 1.3" nil t)) 315 (should (search-forward "Version: 1.3" nil t))
320 (should (search-forward "Summary: A single-file package with no dependencies" 316 (should (search-forward "Summary: A single-file package with no dependencies"
321 nil t)) 317 nil t))
318 (should (search-forward "Homepage: http://doodles.au" nil t))
322 ;; No description, though. Because at this point we don't know 319 ;; No description, though. Because at this point we don't know
323 ;; what archive the package originated from, and we don't have 320 ;; what archive the package originated from, and we don't have
324 ;; its readme file saved. 321 ;; its readme file saved.
325 ))) 322 )))
326 323
327(ert-deftest package-test-describe-not-installed-package ()
328 "Test displaying of the readme for not-installed package."
329
330 (with-package-test ()
331 (package-initialize)
332 (package-refresh-contents)
333 (with-fake-help-buffer
334 (describe-package 'simple-single)
335 (goto-char (point-min))
336 (should (search-forward "This package provides a minor mode to frobnicate"
337 nil t)))))
338
339(ert-deftest package-test-describe-non-installed-package () 324(ert-deftest package-test-describe-non-installed-package ()
340 "Test displaying of the readme for non-installed package." 325 "Test displaying of the readme for non-installed package."
341 326
@@ -345,6 +330,7 @@ Must called from within a `tar-mode' buffer."
345 (with-fake-help-buffer 330 (with-fake-help-buffer
346 (describe-package 'simple-single) 331 (describe-package 'simple-single)
347 (goto-char (point-min)) 332 (goto-char (point-min))
333 (should (search-forward "Homepage: http://doodles.au" nil t))
348 (should (search-forward "This package provides a minor mode to frobnicate" 334 (should (search-forward "This package provides a minor mode to frobnicate"
349 nil t))))) 335 nil t)))))
350 336
@@ -357,6 +343,7 @@ Must called from within a `tar-mode' buffer."
357 (with-fake-help-buffer 343 (with-fake-help-buffer
358 (describe-package 'multi-file) 344 (describe-package 'multi-file)
359 (goto-char (point-min)) 345 (goto-char (point-min))
346 (should (search-forward "Homepage: http://puddles.li" nil t))
360 (should (search-forward "This is a bare-bones readme file for the multi-file" 347 (should (search-forward "This is a bare-bones readme file for the multi-file"
361 nil t))))) 348 nil t)))))
362 349
diff --git a/test/automated/package-x-test.el b/test/automated/package-x-test.el
index beb18358085..c7b82360dd8 100644
--- a/test/automated/package-x-test.el
+++ b/test/automated/package-x-test.el
@@ -48,14 +48,16 @@
48 (cons 'simple-single 48 (cons 'simple-single
49 (package-make-ac-desc '(1 3) nil 49 (package-make-ac-desc '(1 3) nil
50 "A single-file package with no dependencies" 50 "A single-file package with no dependencies"
51 'single)) 51 'single
52 '((:homepage . "http://doodles.au"))))
52 "Expected contents of the archive entry from the \"simple-single\" package.") 53 "Expected contents of the archive entry from the \"simple-single\" package.")
53 54
54(defvar package-x-test--single-archive-entry-1-4 55(defvar package-x-test--single-archive-entry-1-4
55 (cons 'simple-single 56 (cons 'simple-single
56 (package-make-ac-desc '(1 4) nil 57 (package-make-ac-desc '(1 4) nil
57 "A single-file package with no dependencies" 58 "A single-file package with no dependencies"
58 'single)) 59 'single
60 nil))
59 "Expected contents of the archive entry from the updated \"simple-single\" package.") 61 "Expected contents of the archive entry from the updated \"simple-single\" package.")
60 62
61(ert-deftest package-x-test-upload-buffer () 63(ert-deftest package-x-test-upload-buffer ()