claudetool: improve codereview
Do a bunch of un-vibecoding and bug fixing.
Unfortunately, lots left.
Get rid of vet; gopls check covers it.
Add testing infrastructure and a bunch of fixtures.
diff --git a/claudetool/testdata/empty_testdir_add_file.txtar b/claudetool/testdata/empty_testdir_add_file.txtar
new file mode 100644
index 0000000..b754f3d
--- /dev/null
+++ b/claudetool/testdata/empty_testdir_add_file.txtar
@@ -0,0 +1,37 @@
+Test adding a non-empty file to testdata when test expects empty files
+
+-- p_test.go --
+package p
+
+import (
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+func TestEmptyTestdata(t *testing.T) {
+ files, _ := filepath.Glob("testdata/*")
+ for _, path := range files {
+ data, _ := os.ReadFile(path)
+ if len(data) > 0 {
+ t.Fatalf("testdata file is not empty: %s", path)
+ }
+ }
+}
+
+-- testdata/empty --
+-- .commit --
+Initial commit with empty testdata file
+
+-- testdata/nonempty --
+hi
+-- .commit --
+Add non-empty file to testdata
+
+-- .run_test --
+Test regressions detected between initial commit (cdc9ec6dfb8669c11d8aa0df49c72112627784dc) and HEAD:
+
+1: sketch.dev.TestEmptyTestdata: Was passing, now failing
+
+
+Please fix before proceeding.