Files
zeekay c6dc8ac2f7 Hanzo Team
The Go transactor and account service for Hanzo Team.

History starts here. The previous 107 commits carried the fork's origin in
their messages and their tree, and none of it described this code: the Go
under pkg/transactor is Hanzo's own work implementing a wire protocol, not
a port of anyone's implementation.

pkg/transactor/model.json remains, and remains attributed. It is a compiled
platform model this transactor loads through go:embed, governed by EPL-2.0
and named in NOTICE. Removing it is a replacement project -- a new compiler
and a move off the protocol -- not a deletion.
2026-08-30 17:07:38 -07:00

34 lines
951 B
Go

package transactor
import (
"database/sql"
"path/filepath"
"testing"
)
// TestDSNAppliesTheProfile opens a real file and asks the database what it got.
// The DSN string is exactly what differs between the two backends — each ignores
// the other's spelling — so asserting on the string would pass on the build that
// ignores it.
func TestDSNAppliesTheProfile(t *testing.T) {
db, err := sql.Open("sqlite", dsn(filepath.Join(t.TempDir(), "t.db"), "WAL"))
if err != nil {
t.Fatalf("open: %v", err)
}
defer func() { _ = db.Close() }()
for _, c := range []struct{ pragma, want string }{
{"journal_mode", "wal"},
{"busy_timeout", "5000"},
{"foreign_keys", "0"}, // deliberately off: docs has no references
} {
var got string
if err := db.QueryRow("PRAGMA " + c.pragma).Scan(&got); err != nil {
t.Fatalf("PRAGMA %s: %v", c.pragma, err)
}
if got != c.want {
t.Errorf("%s = %q, want %q", c.pragma, got, c.want)
}
}
}