test

package
v5.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package test 提供了整个包的基本测试数据

Index

Constants

This section is empty.

Variables

View Source
var (
	// Sqlite3 Dialect 实例
	Sqlite3 = dialect.Sqlite3("sqlite3")

	// Sqlite Dialect 实例
	Sqlite = dialect.Sqlite3("sqlite")

	// Mysql Dialect 实例
	Mysql = dialect.Mysql("mysql")

	// Mariadb Dialect 实例
	Mariadb = dialect.Mariadb("mysql")

	// Postgres Dialect 实例
	Postgres = dialect.Postgres("postgres")
)

Functions

func Main

func Main(m *testing.M)

Main 供测试的 TestMain 调用

Types

type Driver

type Driver struct {
	*assert.Assertion
	DB         *orm.DB
	DriverName string
	DBName     string
	// contains filtered or unexported fields
}

Driver 单个测试用例

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite 测试用例管理

func NewSuite

func NewSuite(a *assert.Assertion, dialect ...core.Dialect) *Suite

NewSuite 初始化测试内容

dialect 指定了当前需要测试的驱动,若未指定表示测试 flags 中的所有内容。

func (Suite) Run

func (s Suite) Run(f func(*Driver))

Run 为每个数据库测试用例调用 f 进行测试

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL