el-get/test/issues/el-get-issue-1920.el

36 lines
2.2 KiB
EmacsLisp
Raw Normal View History

2014-10-05 23:15:06 +08:00
;; Test for testing `el-get-git-shallow-clone-supported-p' function
;; the function detects whether shallow clone is supported for url
(require 'cl-lib)
2014-10-05 23:15:06 +08:00
;; Tests for lower level function [el-get-git-url-from-known-smart-domains-p]
(cl-assert (el-get-git-shallow-clone-supported-p "https://www.bitbucket.org/alfaromurillo/org-passwords.el.git"))
(cl-assert (el-get-git-url-from-known-smart-domains-p "https://www.github.com/dimitri/el-get"))
(cl-assert (el-get-git-url-from-known-smart-domains-p "https://bitbucket.org/alfaromurillo/org-passwords.el.git"))
(cl-assert (el-get-git-url-from-known-smart-domains-p "https://github.com/dimitri/el-get"))
2014-10-05 23:15:06 +08:00
;; Tests for lower level function [el-get-git-is-host-smart-http-p]
(cl-assert (el-get-git-is-host-smart-http-p "https://github.com/dimitri/el-get.git"))
(cl-assert (el-get-git-is-host-smart-http-p "http://repo.or.cz/r/anything-config.git"))
(cl-assert (not (el-get-git-is-host-smart-http-p "http://www.dr-qubit.org/git/undo-tree.git")))
;; Function should not fail for urls without '.git' prefix
2014-10-05 23:15:06 +08:00
(cl-assert (el-get-git-is-host-smart-http-p "https://github.com/dimitri/el-get"))
(cl-assert (el-get-git-is-host-smart-http-p "http://repo.or.cz/r/anything-config"))
(cl-assert (not (el-get-git-is-host-smart-http-p "http://www.dr-qubit.org/git/undo-tree")))
2014-10-05 23:15:06 +08:00
;; Tests for function [el-get-git-shallow-clone-supported-p]
;; `git', `ssh' and `file' support shallow clones
2014-10-05 23:15:06 +08:00
(cl-assert (el-get-git-shallow-clone-supported-p "git://gitorious.org/evil/evil.git"))
(cl-assert (el-get-git-shallow-clone-supported-p "file:///opt/git/project.git"))
(cl-assert (el-get-git-shallow-clone-supported-p "ssh://some_user@some_server/some_project.git"))
;; The following repos support shallow clones
2014-10-05 23:15:06 +08:00
(cl-assert (el-get-git-shallow-clone-supported-p "http://repo.or.cz/r/anything-config.git"))
(cl-assert (el-get-git-shallow-clone-supported-p "https://github.com/dimitri/el-get"))
(cl-assert (el-get-git-shallow-clone-supported-p "https://bitbucket.org/alfaromurillo/org-passwords.el.git"))
;; The following do not support shallow clones
2014-10-05 23:15:06 +08:00
(cl-assert (not (el-get-git-shallow-clone-supported-p "http://www.dr-qubit.org/git/undo-tree.git/")))
(cl-assert (not (el-get-git-shallow-clone-supported-p "http://michael.orlitzky.com/git/nagios-mode.git")))