summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian Wiesner <lunaryorn@gmail.com>2014-03-13 12:00:46 +0100
committerSebastian Wiesner <lunaryorn@gmail.com>2014-03-13 12:00:46 +0100
commit8521c70b19e9c1074cde6980a44490926abf4211 (patch)
tree1ef28d2aed0d9fa6875a3ed064b7e04426645331 /test
parenta4e50fbd93c7596aa76a5ef2964c49b084184227 (diff)
Favor X-Original-Version over standard header for version info
If X-Original-Version is present, we assume that MELPA replaced the library version with its generated package version, so we ignore the library version and take the X-Original-Version instead. This makes pkg-info-version-info finally useful for single-file packages from MELPA.
Diffstat (limited to 'test')
-rw-r--r--test/pkg-info-test.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/pkg-info-test.el b/test/pkg-info-test.el
index c0b151a..3058fee 100644
--- a/test/pkg-info-test.el
+++ b/test/pkg-info-test.el
@@ -136,6 +136,15 @@
(format "%s (package: 3.4.2.1)"
(pkg-info-format-version pkg-info-ruby-mode-version)))))
+(ert-deftest pkg-info-version-info/library-with-original-version ()
+ (should (equal
+ (pkg-info-version-info "pkg-info-dummy-original-version") "1.3")))
+
+(ert-deftest pkg-info-version-info/library-and-package-with-original-version ()
+ (should (equal (pkg-info-version-info "pkg-info-dummy-original-version"
+ 'pkg-info-dummy-package)
+ "1.3 (package: 3.4.2.1)")))
+
(ert-deftest pkg-info-version-info/package-does-not-exist ()
(should (equal (pkg-info-version-info 'pkg-info-dummy-package 'no-such-package)
"3.4.2.1")))