(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestHasTable(t *testing.T) { |
| 18 | t.Parallel() |
| 19 | |
| 20 | app, _ := tests.NewTestApp() |
| 21 | defer app.Cleanup() |
| 22 | |
| 23 | scenarios := []struct { |
| 24 | tableName string |
| 25 | expected bool |
| 26 | }{ |
| 27 | {"", false}, |
| 28 | {"test", false}, |
| 29 | {core.CollectionNameSuperusers, true}, |
| 30 | {"demo3", true}, |
| 31 | {"DEMO3", true}, // table names are case insensitives by default |
| 32 | {"view1", true}, // view |
| 33 | } |
| 34 | |
| 35 | for _, s := range scenarios { |
| 36 | t.Run(s.tableName, func(t *testing.T) { |
| 37 | result := app.HasTable(s.tableName) |
| 38 | if result != s.expected { |
| 39 | t.Fatalf("Expected %v, got %v", s.expected, result) |
| 40 | } |
| 41 | }) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestAuxHasTable(t *testing.T) { |
| 46 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…