go-loose/internal/database/database_test.go

14 lines
336 B
Go
Raw Normal View History

2026-10-01 23:15:57 +02:00
package database
import "testing"
func TestUpSection(t *testing.T) {
got, err := upSection("-- +goose Up\nCREATE TABLE example(id int);\n-- +goose Down\nDROP TABLE example;")
if err != nil {
t.Fatalf("upSection() error = %v", err)
}
if got != "\nCREATE TABLE example(id int);\n" {
t.Fatalf("unexpected section: %q", got)
}
}