Rename the main module to gotea.dev and the binary to gotea, and update the application name and English locale. Keep the external gitea.dev/sdk and gitea.dev/actionslib module imports unchanged. Assisted-by: OpenCode:DeepSeek-V4.1-Flash
29 lines
824 B
Go
29 lines
824 B
Go
// Copyright 2024 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package modelmigration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gotea.dev/modules/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestMigrations(t *testing.T) {
|
|
defer test.MockVariableValue(&preparedMigrations)()
|
|
preparedMigrations = []*migration{
|
|
{idNumber: 70},
|
|
{idNumber: 71},
|
|
}
|
|
assert.EqualValues(t, 72, calcDBVersion(preparedMigrations))
|
|
assert.EqualValues(t, 72, ExpectedDBVersion())
|
|
|
|
assert.EqualValues(t, 71, migrationIDNumberToDBVersion(70))
|
|
|
|
assert.Equal(t, []*migration{{idNumber: 70}, {idNumber: 71}}, getPendingMigrations(70, preparedMigrations))
|
|
assert.Equal(t, []*migration{{idNumber: 71}}, getPendingMigrations(71, preparedMigrations))
|
|
assert.Equal(t, []*migration{}, getPendingMigrations(72, preparedMigrations))
|
|
}
|