Skip to content

Commit 3bc77a6

Browse files
committed
Test the error reporing on broken migration reversal
1 parent 6069fe9 commit 3bc77a6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

executor_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,17 @@ func TestSQLExecutor_Down(t *testing.T) {
5858
assert.NotNil(t, err)
5959
})
6060
}
61+
62+
func TestSQLExecutor_Down_Broken(t *testing.T) {
63+
td := filepath.Join(dbSrc, "20180920181906_migration_with_an_error")
64+
65+
exe := NewSQLExecutor(db)
66+
67+
migration, err := MigrationFromBytes(td, ioutil.ReadFile)
68+
assert.Nil(t, err)
69+
70+
cleanState(func() {
71+
err := exe.Down(migration, new(testingStore))
72+
assert.Error(t, err)
73+
})
74+
}

0 commit comments

Comments
 (0)