fix: make MySQL writer execute generated DDL

This commit is contained in:
SG Command
2026-10-03 12:42:07 +02:00
parent 7a9219b6e3
commit 778379538b
2 changed files with 30 additions and 4 deletions
+7
View File
@@ -9,6 +9,13 @@ import (
"git.warky.dev/wdevs/relspecgo/pkg/writers"
)
func TestStripComments(t *testing.T) {
got := stripComments("-- header\nCREATE TABLE `users` (\n `id` INT\n);")
if strings.HasPrefix(got, "--") || !strings.HasPrefix(got, "CREATE TABLE") {
t.Fatalf("stripComments() = %q", got)
}
}
func TestWriterGeneratesMySQLDDL(t *testing.T) {
db := models.InitDatabase("app")
s := models.InitSchema("app")