3 Star 0 Fork 0

Gitee 极速下载/sql-migrate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/rubenv/sql-migrate
克隆/下载
sort_test.go 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
package migrate
import (
"sort"
//revive:disable-next-line:dot-imports
. "gopkg.in/check.v1"
)
type SortSuite struct{}
var _ = Suite(&SortSuite{})
func (*SortSuite) TestSortMigrations(c *C) {
migrations := byId([]*Migration{
{Id: "10_abc", Up: nil, Down: nil},
{Id: "120_cde", Up: nil, Down: nil},
{Id: "1_abc", Up: nil, Down: nil},
{Id: "efg", Up: nil, Down: nil},
{Id: "2_cde", Up: nil, Down: nil},
{Id: "35_cde", Up: nil, Down: nil},
{Id: "3_efg", Up: nil, Down: nil},
{Id: "4_abc", Up: nil, Down: nil},
})
sort.Sort(migrations)
c.Assert(migrations, HasLen, 8)
c.Assert(migrations[0].Id, Equals, "1_abc")
c.Assert(migrations[1].Id, Equals, "2_cde")
c.Assert(migrations[2].Id, Equals, "3_efg")
c.Assert(migrations[3].Id, Equals, "4_abc")
c.Assert(migrations[4].Id, Equals, "10_abc")
c.Assert(migrations[5].Id, Equals, "35_cde")
c.Assert(migrations[6].Id, Equals, "120_cde")
c.Assert(migrations[7].Id, Equals, "efg")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/sql-migrate.git
git@gitee.com:mirrors/sql-migrate.git
mirrors
sql-migrate
sql-migrate
master

搜索帮助