- 4 tests for kappa bump: version update, version written to file, source URL preserved, requires version arg - 3 tests for kappa bump-all: finds newer version, reports count, requires directory arg Total: 103 → 110 in test-full.sh (30+23+110 = 163 overall)
This commit is contained in:
@@ -1101,6 +1101,68 @@ check "upgrade dry-run does not apply" \
|
||||
"$KAPPA upgrade --dry-run 2>&1" \
|
||||
'run kappa add'
|
||||
|
||||
|
||||
|
||||
echo ""
|
||||
echo "=== Bump: explicit version update ==="
|
||||
echo ""
|
||||
|
||||
cat > "$TMPDIR/bump-test.kap" << 'BMPEOF'
|
||||
package "bumpme" {
|
||||
const version = "4.4.0"
|
||||
const source = "https://ftp.gnu.org/gnu/make/make-${version}.tar.gz"
|
||||
sha256 = "oldhash"
|
||||
license = "GPL-3.0-or-later"
|
||||
build { make }
|
||||
install { make install }
|
||||
}
|
||||
BMPEOF
|
||||
|
||||
check "bump updates version" \
|
||||
"$KAPPA bump $TMPDIR/bump-test.kap 4.4.1" \
|
||||
'bumped bumpme'
|
||||
|
||||
check "bump writes correct version" \
|
||||
"grep -c '4.4.1' $TMPDIR/bump-test.kap" \
|
||||
'1'
|
||||
|
||||
check "bump preserves source URL" \
|
||||
"grep -c 'make-' $TMPDIR/bump-test.kap" \
|
||||
'1'
|
||||
|
||||
check_fail "bump requires version arg" \
|
||||
"$KAPPA bump $TMPDIR/bump-test.kap" \
|
||||
'requires'
|
||||
|
||||
echo ""
|
||||
echo "=== Bump-all: directory scan ==="
|
||||
echo ""
|
||||
|
||||
BPALLDIR="$TMPDIR/bumpall-pkgs"
|
||||
mkdir -p "$BPALLDIR"
|
||||
|
||||
cat > "$BPALLDIR/make.kap" << 'BMPEOF'
|
||||
package "make" {
|
||||
const version = "4.4.0"
|
||||
const source = "https://ftp.gnu.org/gnu/make/make-${version}.tar.gz"
|
||||
sha256 = "old"
|
||||
license = "GPL-3.0-or-later"
|
||||
build { make }
|
||||
install { make install }
|
||||
}
|
||||
BMPEOF
|
||||
|
||||
check "bump-all finds newer version" \
|
||||
"$KAPPA bump-all $BPALLDIR" \
|
||||
'4.4.0 → 4.4.1'
|
||||
|
||||
check "bump-all reports count" \
|
||||
"$KAPPA bump-all $BPALLDIR" \
|
||||
'bumped'
|
||||
|
||||
check_fail "bump-all needs directory" \
|
||||
"$KAPPA bump-all" \
|
||||
'requires a directory'
|
||||
rm -f "$KAPPA_ROOT/db/installed"
|
||||
echo "=== Rebuild: dry-run detection ==="
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user