(t *testing.T, conf *Config, primarySchema string, names ...string)
| 142 | } |
| 143 | |
| 144 | func newTestEngineWithTables(t *testing.T, conf *Config, primarySchema string, names ...string) (*graphjinEngine, *bytes.Buffer) { |
| 145 | t.Helper() |
| 146 | tables := make([]sdata.DBTable, 0, len(names)) |
| 147 | for _, n := range names { |
| 148 | tables = append(tables, sdata.DBTable{Schema: primarySchema, Name: n, Type: "table"}) |
| 149 | } |
| 150 | var logBuf bytes.Buffer |
| 151 | gj := &graphjinEngine{ |
| 152 | conf: conf, |
| 153 | log: _log.New(&logBuf, "", 0), |
| 154 | defaultDB: "primary", |
| 155 | databases: map[string]*dbContext{ |
| 156 | "primary": {name: "primary", dbinfo: &sdata.DBInfo{Schema: primarySchema, Tables: tables}}, |
| 157 | }, |
| 158 | } |
| 159 | return gj, &logBuf |
| 160 | } |
| 161 | |
| 162 | func TestCollisionWithRealTableErrors(t *testing.T) { |
| 163 | gj, _ := newTestEngineWithTables(t, &Config{}, "public", "users", "orders") |
no outgoing calls
no test coverage detected