| 89 | } |
| 90 | |
| 91 | func TestRemoveGolangMigrateRollback(t *testing.T) { |
| 92 | filenames := map[string]bool{ |
| 93 | // make sure we let through golang-migrate files that aren't rollbacks |
| 94 | "migrations/1.up.sql": false, |
| 95 | // make sure we let through other sql files |
| 96 | "migrations/2.sql": false, |
| 97 | "migrations/foo.sql": false, |
| 98 | "migrations/1.down.sql": true, |
| 99 | } |
| 100 | |
| 101 | for filename, want := range filenames { |
| 102 | got := IsDown(filename) |
| 103 | if diff := cmp.Diff(want, got); diff != "" { |
| 104 | t.Errorf("IsDown mismatch: %s\n %s", filename, diff) |
| 105 | } |
| 106 | } |
| 107 | } |