diff options
| author | xengineering <me@xengineering.eu> | 2026-06-02 20:12:53 +0200 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2026-06-02 20:12:53 +0200 |
| commit | 975349b50e3d2c76564fef686a2a33b01212b6d3 (patch) | |
| tree | 24188d1c0d2d6772b7f107383238e93b7db3424e /database_test.go | |
| parent | a750aa4ecf7ecab519b53d7f3ac082425ba50686 (diff) | |
| download | finserv-975349b50e3d2c76564fef686a2a33b01212b6d3.tar finserv-975349b50e3d2c76564fef686a2a33b01212b6d3.tar.zst finserv-975349b50e3d2c76564fef686a2a33b01212b6d3.zip | |
Name tests like functions to test
This enforces a similar structure of test functions named `TestFooBar`
if they test the function `FooBar`.
Diffstat (limited to 'database_test.go')
| -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) |
