-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema_test.go
28 lines (24 loc) · 1021 Bytes
/
schema_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package sqlsmith
import (
"testing"
// "github.com/stretchr/testify/assert"
)
func TestSQLSmith_Schema_TableMerge(t *testing.T) {
// ss := New()
// ss.LoadSchema([][5]string{
// {"test", "balances", "BASE TABLE", "id", "int(11)"},
// {"test", "balances", "BASE TABLE", "user", "varchar(255)"},
// {"test", "balances", "BASE TABLE", "money", "int(11)"},
// {"test", "records", "BASE TABLE", "id", "int(11)"},
// {"test", "records", "BASE TABLE", "from_id", "int(11)"},
// {"test", "records", "BASE TABLE", "to_id", "int(11)"},
// {"test", "records", "BASE TABLE", "created_at", "timestamp"},
// })
// table, onColumns := ss.mergeTable(ss.Databases["test"].Tables["balances"], ss.Databases["test"].Tables["records"])
// assert.Equal(t, len(onColumns), 2)
// assert.Equal(t, onColumns[0].Table, "balances")
// assert.Equal(t, onColumns[0].Column, "id")
// assert.Equal(t, onColumns[1].Table, "records")
// assert.Equal(t, onColumns[1].Column, "id")
// assert.Equal(t, len(table.Columns), 7)
}