diff options
| -rw-r--r-- | database_test.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/database_test.go b/database_test.go index 66ffc37..d285c95 100644 --- a/database_test.go +++ b/database_test.go @@ -8,21 +8,19 @@ import ( "testing" ) -func TestMigrationNumber(t *testing.T) { +func TestReadMigrations(t *testing.T) { n := len(migrations) entries, err := os.ReadDir(migrationDir) if err != nil { t.Fatalf("Failed to determine number of migration files: %v", err) } - expectation := len(entries) + nMigrationFiles := len(entries) - if n != expectation { - t.Fatalf("Expected %d migration files but got %d.", expectation, n) + if n != nMigrationFiles { + t.Fatalf("Expected %d migration files but got %d.", nMigrationFiles, n) } -} -func TestMigrationContent(t *testing.T) { for i, migration := range migrations { path := migrationPath(i) @@ -33,7 +31,7 @@ func TestMigrationContent(t *testing.T) { } } -func TestMigrations(t *testing.T) { +func TestMigrate(t *testing.T) { db, _ := emptyDB(t) userVersion, err := UserVersion(db) |
