...
1 package source
2
3 import (
4 "testing"
5 )
6
7 func TestNewMigrations(t *testing.T) {
8
9 }
10
11 func TestAppend(t *testing.T) {
12
13 }
14
15 func TestBuildIndex(t *testing.T) {
16
17 }
18
19 func TestFirst(t *testing.T) {
20
21 }
22
23 func TestPrev(t *testing.T) {
24
25 }
26
27 func TestUp(t *testing.T) {
28
29 }
30
31 func TestDown(t *testing.T) {
32
33 }
34
35 func TestFindPos(t *testing.T) {
36 m := Migrations{index: uintSlice{1, 2, 3}}
37 if p := m.findPos(0); p != -1 {
38 t.Errorf("expected -1, got %v", p)
39 }
40 if p := m.findPos(1); p != 0 {
41 t.Errorf("expected 0, got %v", p)
42 }
43 if p := m.findPos(3); p != 2 {
44 t.Errorf("expected 2, got %v", p)
45 }
46 }
47
View as plain text