migrate/source/migration_test.go

47 lines
643 B
Go
Raw Normal View History

2017-02-10 03:42:48 +00:00
package source
import (
"testing"
)
func TestNewMigrations(t *testing.T) {
// TODO
}
func TestAppend(t *testing.T) {
// TODO
}
func TestBuildIndex(t *testing.T) {
// TODO
}
func TestFirst(t *testing.T) {
// TODO
}
func TestPrev(t *testing.T) {
// TODO
}
func TestUp(t *testing.T) {
// TODO
}
func TestDown(t *testing.T) {
// TODO
}
2017-02-15 18:48:43 +00:00
func TestFindPos(t *testing.T) {
m := Migrations{index: uintSlice{1, 2, 3}}
if p := m.findPos(0); p != -1 {
t.Errorf("expected -1, got %v", p)
}
if p := m.findPos(1); p != 0 {
t.Errorf("expected 0, got %v", p)
}
if p := m.findPos(3); p != 2 {
t.Errorf("expected 2, got %v", p)
}
}