test: audit and clean up test suite

Delete tautological, no-assertion, and permanently-skipped tests.
Rewrite false-confidence tests that couldn't detect the bugs they
claimed to test. Decouple brittle assertions from error message
strings and third-party library output. Fix misleading test names
and error messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christopher Allen Lane
2026-02-15 12:42:11 -05:00
parent d4a8a79628
commit 971be88150
12 changed files with 67 additions and 301 deletions

View File

@@ -9,7 +9,6 @@ import (
"os/exec"
"path/filepath"
"testing"
"time"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
@@ -108,23 +107,15 @@ cheatpaths:
cmd := exec.Command(cheatBin, tc.args...)
cmd.Env = env
// Capture output to prevent spamming
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
start := time.Now()
err := cmd.Run()
elapsed := time.Since(start)
if err != nil {
b.Fatalf("Command failed: %v\nStderr: %s", err, stderr.String())
}
// Report custom metric
b.ReportMetric(float64(elapsed.Nanoseconds())/1e6, "ms/op")
// Ensure we got some results
if stdout.Len() == 0 {
b.Fatal("No output from search")
}