INNER CODE UNIT · Go
init
simagix/hatchet · audit_test.go:18
func init() {
// Register regexp function for modernc.org/sqlite
sqlite.MustRegisterDeterministicScalarFunction("regexp", 2, func(ctx *sqlite.FunctionContext, args []driver.Value) (driver.Value, error) {
pattern, _ := args[0].(string)
s, _ := args[1].(string)
return regexp.MatchString(pattern, s)
})
}
func TestGetAuditDataWithClosedConnections(t *testing.T) {
// Create a temporary database
tmpDir := os.TempDir()
dbfile := filepath.Join(tmpDir, "test_audit.db")
defer os.Remove(dbfile)
hatchetName := "test_hatchet"
sqlite, err := NewSQLite3DB(dbfile, hatchetName, 2000)
if err != nil {