diff options
Diffstat (limited to 'db/atlasdb/db_test.go')
-rw-r--r-- | db/atlasdb/db_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/db/atlasdb/db_test.go b/db/atlasdb/db_test.go new file mode 100644 index 0000000..1af59f1 --- /dev/null +++ b/db/atlasdb/db_test.go @@ -0,0 +1,31 @@ +package atlasdb + +import ( + "context" + "path/filepath" + "testing" + + _ "github.com/mattn/go-sqlite3" + "github.com/pg9182/atlas/pkg/api/api0/api0testutil" +) + +func TestAccountStorage(t *testing.T) { + db, err := Open(filepath.Join(t.TempDir(), "atlas.db")) + if err != nil { + panic(err) + } + defer db.Close() + + cur, tgt, err := db.Version() + if err != nil { + panic(err) + } + if cur != 0 { + panic("current version not 0") + } + if err := db.MigrateUp(context.Background(), tgt); err != nil { + panic(err) + } + + api0testutil.TestAccountStorage(t, db) +} |