Учесть замечания ревью: читать timestamptz в UTC, встроить списки колонок, не требовать каноническую PHC-строку, уточнить замеры отказов

This commit is contained in:
2026-10-21 15:08:17 +03:00
parent 956b84f2d7
commit 7aa86d36ba
7 changed files with 37 additions and 23 deletions
@@ -31,6 +31,16 @@ func TestMain(m *testing.M) {
os.Exit(code)
}
func TestPoolScansTimestamptzInUTC(t *testing.T) {
var got time.Time
if err := db.Pool.QueryRow(context.Background(), `SELECT now()`).Scan(&got); err != nil {
t.Fatal(err)
}
if got.Location() != time.UTC {
t.Fatalf("timestamptz scanned in %v, want UTC", got.Location())
}
}
func TestMigrateIsRepeatable(t *testing.T) {
ctx := context.Background()
applied, err := postgres.Migrate(ctx, db.Pool)