Skip to content

Commit 4e369b4

Browse files
committed
Test reinstall command
1 parent 7348a31 commit 4e369b4

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

test/exit-status/reinstall/Eask

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(package "check-clean" "0.0.1" "mock package")
2+
3+
(package-file "lint.el")
4+
5+
(source 'gnu)
6+
7+
(development
8+
(depends-on "ert")
9+
(depends-on "dash"))
10+
;; (depends-on "not-a-package")

test/exit-status/reinstall/lint.el

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
;;; lint.el --- Test the command package -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2022-2024 the Eask authors.
4+
5+
;; This program is free software; you can redistribute it and/or modify
6+
;; it under the terms of the GNU General Public License as published by
7+
;; the Free Software Foundation, either version 3 of the License, or
8+
;; (at your option) any later version.
9+
10+
;; This program is distributed in the hope that it will be useful,
11+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
;; GNU General Public License for more details.
14+
15+
;; You should have received a copy of the GNU General Public License
16+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
;;; Version: 0.0.1
19+
20+
;;; Commentary:
21+
22+
;;; Code:
23+
24+
(declare-function ignore "subr.el" (&rest args))
25+
26+
(provide 'lint)
27+
28+
;;; lint.el ends here

test/exit-status/reinstall/run.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2024 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Tests "reinstall" command
21+
22+
set -e
23+
24+
source ./test/fixtures/home/scripts/testing.sh
25+
cd $(dirname "$0")
26+
27+
# FIXME
28+
# unclear what should happen here
29+
# message seems to suggest that the package-file will be uninstalled
30+
# but this does not work, e.g. eask install -> eask uninstall does not undo
31+
# should_error eask reinstall
32+
33+
# TODO this is some weird bug with install
34+
eask install || true # this fails, seems to want to print a message but throws
35+
eask install lint # already installed, but without the previous step it would fail
36+
37+
# now it thinks this is unavailable
38+
should_run eask reinstall lint
39+
# FIXME no effect
40+
# should_error eask reinstall --strict lint
41+
42+
# reinstall a package that isn't installed
43+
should_run eask reinstall s
44+
45+
# reinstall a built-in package
46+
# FIXME huge stack trace
47+
should_error eask reinstall ert
48+
49+
# seems like neither --strict or --allow-error has any effect

0 commit comments

Comments
 (0)