MCPcopy Create free account
hub / github.com/AdRoll/baker / TestSQLiteBadConfig

Function TestSQLiteBadConfig

output/sqlite_test.go:333–368  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

331}
332
333func TestSQLiteBadConfig(t *testing.T) {
334 tests := []struct {
335 name string
336 pathstring string
337 }{
338 {
339 name: "bad template",
340 pathstring: "{{\x00",
341 },
342 }
343
344 for _, tt := range tests {
345 t.Run(tt.name, func(t *testing.T) {
346 cfg := &SQLiteRawWriterConfig{
347 PathString: tt.pathstring,
348 TableName: "lines",
349 Clear: false,
350 RecordBlobName: "blob",
351 }
352
353 params := baker.OutputParams{
354 Fields: []baker.FieldIndex{1},
355 Index: 0,
356 ComponentParams: baker.ComponentParams{
357 DecodedConfig: cfg,
358 FieldByName: func(string) (baker.FieldIndex, bool) { return 0, true },
359 FieldName: func(baker.FieldIndex) string { return "name" },
360 },
361 }
362 _, err := newSQLiteWriter(true)(params)
363 if err == nil {
364 t.Fatalf("want error, got nil")
365 }
366 })
367 }
368}

Callers

nothing calls this directly

Calls 1

RunMethod · 0.65

Tested by

no test coverage detected