1 Star 0 Fork 0

guxk / xorm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dialect_sqlite3_test.go 787 Bytes
一键复制 编辑 原始数据 按行查看 历史
guxk 提交于 2023-08-02 20:33 . 新建仓库
// Copyright 2019 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package xorm
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSplitColStr(t *testing.T) {
var kases = []struct {
colStr string
fields []string
}{
{
colStr: "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL",
fields: []string{
"`id`", "INTEGER", "PRIMARY", "KEY", "AUTOINCREMENT", "NOT", "NULL",
},
},
{
colStr: "`created` DATETIME DEFAULT '2006-01-02 15:04:05' NULL",
fields: []string{
"`created`", "DATETIME", "DEFAULT", "'2006-01-02 15:04:05'", "NULL",
},
},
}
for _, kase := range kases {
assert.EqualValues(t, kase.fields, splitColStr(kase.colStr))
}
}
1
https://gitee.com/guxk/xorm.git
git@gitee.com:guxk/xorm.git
guxk
xorm
xorm
master

搜索帮助