test: tidy misplaced, stale, and redundant tests (#691)

Tests now sit beside the code they cover; ones a golden or another test already pins are gone, and core tests gain the assertions a real regression would trip.
This commit is contained in:
Roger authored and GitHub committed 2026-11-09 17:25:37 +08:00
1 parent 7e6f325508
commit 2e7ee3c69f
54 files changed
+913 -1509

No files matched your search

+7 -2
View File
@@ -39,8 +39,13 @@ func TestOpen(t *testing.T) {
}
func TestOpen_JournalOff(t *testing.T) {
path := createDB(t, "CREATE TABLE t (v TEXT)", "INSERT INTO t VALUES ('x')")
assert.Equal(t, "x", readValue(t, path, JournalOff))
database, err := Open(createDB(t, "CREATE TABLE t (v TEXT)"), JournalOff)
require.NoError(t, err)
defer database.Close()
var mode string
require.NoError(t, database.QueryRow("PRAGMA journal_mode").Scan(&mode))
assert.Equal(t, "off", mode)
}
func TestOpen_ReadOnlyImmutable(t *testing.T) {