You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/db/schema/testing.go

28 lines
655 B

package schema
import (
"testing"
)
// Creates a new migrationState only with the versions <= the provided maxVer
func TestCreatePartialMigrationState(om migrationState, maxVer int) migrationState {
nState := migrationState{
upMigrations: make(map[int][]byte),
}
for k := range om.upMigrations {
if k > maxVer {
// Don't store any versions past our test version.
continue
}
nState.upMigrations[k] = om.upMigrations[k]
if nState.binarySchemaVersion < k {
nState.binarySchemaVersion = k
}
}
return nState
}
func TestCloneMigrationStates(t *testing.T) map[string]migrationState {
return cloneMigrationStates(migrationStates)
}