test: add 7 tests for kappa bump and bump-all
CI / build-and-test (push) Successful in 42s

- 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:
2026-08-05 07:58:35 -04:00
parent 1f61f116f8
commit d0ff52a5d7
+62
View File
@@ -1101,6 +1101,68 @@ check "upgrade dry-run does not apply" \
"$KAPPA upgrade --dry-run 2>&1" \ "$KAPPA upgrade --dry-run 2>&1" \
'run kappa add' '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" rm -f "$KAPPA_ROOT/db/installed"
echo "=== Rebuild: dry-run detection ===" echo "=== Rebuild: dry-run detection ==="
echo "" echo ""