Add minimal compilation smoke test; tidy go.mod
Some checks failed
check / check (push) Failing after 59s

Add a smoke test that references the package's exported surface so go
test fails if it stops compiling. Run go mod tidy to promote cobra to
a direct dependency.
This commit is contained in:
2026-06-28 10:09:56 +02:00
parent 7316054b07
commit 8845f0ade6
2 changed files with 22 additions and 1 deletions

2
go.mod
View File

@@ -3,6 +3,7 @@ module git.eeqj.de/sneak/bsdaily
go 1.26.4 go 1.26.4
require ( require (
github.com/spf13/cobra v1.10.2
golang.org/x/sys v0.41.0 golang.org/x/sys v0.41.0
modernc.org/sqlite v1.44.3 modernc.org/sqlite v1.44.3
) )
@@ -14,7 +15,6 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.9 // indirect github.com/spf13/pflag v1.0.9 // indirect
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
modernc.org/libc v1.67.6 // indirect modernc.org/libc v1.67.6 // indirect

View File

@@ -0,0 +1,21 @@
package bsdaily
import "testing"
// TestCompiles is a minimal smoke test that references the package's exported
// surface so that `go test` fails if the package stops compiling. It does not
// touch the filesystem or any of the hard-coded production paths.
func TestCompiles(t *testing.T) {
if DBFilename == "" || WALFilename == "" || SHMFilename == "" {
t.Fatal("expected database filename constants to be set")
}
if SnapshotBase == "" || TmpBase == "" || DailiesBase == "" {
t.Fatal("expected base path constants to be set")
}
if MinTmpFreeBytes == 0 || MinDailiesFreeBytes == 0 {
t.Fatal("expected free-space thresholds to be set")
}
if ErrNoPosts == nil {
t.Fatal("expected ErrNoPosts sentinel to be set")
}
}