From d0ff52a5d7af440e64bdd54d974ca1ab4dc241cd Mon Sep 17 00:00:00 2001 From: huntedbytheirs Date: Wed, 5 Aug 2026 07:58:35 -0400 Subject: [PATCH] test: add 7 tests for kappa bump and bump-all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- test-full.sh | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test-full.sh b/test-full.sh index cf2439d..7cb3307 100755 --- a/test-full.sh +++ b/test-full.sh @@ -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 ""