test: expand coverage across readers, writers, cmd, ui, diff and merge
Implements tests/_plans and previously deferred packages; updates plan README with new coverage numbers.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package transform
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
)
|
||||
|
||||
// Validation and normalization are currently pass-through stubs; these tests
|
||||
// pin that contract (no error, input returned unchanged).
|
||||
func TestTransformerStubs(t *testing.T) {
|
||||
tr := NewTransformer()
|
||||
if tr == nil {
|
||||
t.Fatal("nil transformer")
|
||||
}
|
||||
db := models.InitDatabase("d")
|
||||
schema := models.InitSchema("public")
|
||||
table := models.InitTable("t", "public")
|
||||
|
||||
if err := tr.ValidateDatabase(db); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if err := tr.ValidateSchema(schema); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if err := tr.ValidateTable(table); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if got, err := tr.NormalizeDatabase(db); err != nil || got != db {
|
||||
t.Errorf("NormalizeDatabase = %v, %v", got, err)
|
||||
}
|
||||
if got, err := tr.NormalizeSchema(schema); err != nil || got != schema {
|
||||
t.Errorf("NormalizeSchema = %v, %v", got, err)
|
||||
}
|
||||
if got, err := tr.NormalizeTable(table); err != nil || got != table {
|
||||
t.Errorf("NormalizeTable = %v, %v", got, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user