|
| 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 "link" command's option handling and error behaviour. |
| 21 | + |
| 22 | +set -e |
| 23 | + |
| 24 | +source ./test/fixtures/home/scripts/testing.sh |
| 25 | +cd $(dirname "$0") |
| 26 | + |
| 27 | +# partial input |
| 28 | +should_error eask link |
| 29 | +should_error eask link add |
| 30 | +# FIXME should error |
| 31 | +# should_error eask link delete |
| 32 | + |
| 33 | +# FIXME stack trace when package name doesn't match link name |
| 34 | +# prefer a better warning if this is important |
| 35 | +# should_run eask link add foo ../fixtures/valid/ |
| 36 | + |
| 37 | +should_run eask link add valid-package ../fixtures/valid/ |
| 38 | + |
| 39 | +# FIXME stack trace when package doesn't have -pkg.el |
| 40 | +# FIXME stack trace when link name does not match package name |
| 41 | +# should_run eask link add valid-package ../install/ |
| 42 | + |
| 43 | +OUTPUT="$(should_run eask link list)" |
| 44 | +echo "$OUTPUT" |
| 45 | +should_match "valid-package" "$OUTPUT" |
| 46 | + |
| 47 | +# when package/link doesn't exist |
| 48 | +# FIXME: doesn't error |
| 49 | +# should_error eask link delete foo |
| 50 | + |
| 51 | +# no package after delete |
| 52 | +# FIXME: can't delete using original link name, must use full name with version |
| 53 | +# e.g. valid-package-0.0.1 works, but expect valid-package to work also |
| 54 | +# OUTPUT=$(should_run eask link delete valid-package) |
| 55 | +# echo "$OUTPUT" |
| 56 | +# should_match "1 package unlinked" "$OUTPUT" |
0 commit comments