el-get-issue-513.el 1.52 KB
Newer Older
1 2 3 4
;; https://github.com/dimitri/el-get/issues/513
;;
;; Testing the github and emacsmirror methods

5 6
(setq debug-on-error t
      el-get-verbose t)
7

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
(condition-case nil
    (error "THROW")
  (error (message "Caught an error")))

;; ;; Install a github-type recipe
;; (el-get 'sync 'window-layout)
;; ;; Install an emacsmirror-type recipe
;; (el-get 'sync 'dired-plus)

;; Try to install a recipe for a nonexistent github repo
(condition-case err
    (progn
      ;; Should fail
      (let ((el-get-sources
             '((:name valid-recipe-for-nonexistent-repo
                      :pkgname "xjklfjdlfs/fdjsklfdsj"
                      :type github)))
            ;; This seems to escape error handlers when
            ;; `debug-on-error' is t.
            (debug-on-error nil))
        (el-get 'sync 'valid-recipe-for-nonexistent-repo))
      (signal 'test-failure
              '("The package \"valid-recipe-for-nonexistent-repo\" should have caused an error, but it didn't.")))
  (error (message "Installing \"valid-recipe-for-nonexistent-repo\" failed as expected. The error message was: %S" err)))
32 33 34 35 36

(condition-case err
    (progn
      ;; Should fail
      (let ((el-get-sources
37
             '((:name broken-github-recipe
38
                      :type github))))
39
        (el-get 'sync 'broken-github-recipe))
40
      (signal 'test-failure
41 42
              '("The package \"broken-github-recipe\" should have caused an error, but it didn't.")))
  (error (message "Installing \"broken-github-recipe\" failed as expected. The error message was: %S" err)))