首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏代码工具

    golang测试框架goconvey的使用

    github地址:https://github.com/smartystreets/goconvey以下是官方列举的goconvey的几个特性:直接集成go test可以管理和运行测试用例提供了丰富的断言函数支持很多 安装go get github.com/smartystreets/goconvey2. "github.com/smartystreets/goconvey/convey")func TestSpec(t *testing.T) {// Only pass t into top-level [image.png]更多请参考官方iwiki:https://github.com/smartystreets/goconvey/wiki/Documentation

    4.2K30编辑于 2022-06-30
  • 来自专栏sunsky

    Golang依赖管理工具:glide从入门到精通使用

    go-simplejson - package: git.oschina.net/qiangmzsx/beegofreecache testImport: - package: github.com/smartystreets testImport": [ { "subpackages": [ "convey" ], "package": "github.com/smartystreets --> Fetching updates for github.com/coocood/freecache [INFO] --> Fetching updates for github.com/smartystreets --> Fetching updates for github.com/coocood/freecache [INFO] --> Fetching updates for github.com/smartystreets [INFO] --> Exporting github.com/smartystreets/goconvey [INFO] --> Exporting github.com/garyburd

    2.8K20发布于 2020-08-20
  • 来自专栏每日一善

    每天坚持20分钟编写测试

    "github.com/smartystreets/goconvey/convey")func TestAdd(t *testing.T) {Convey("test add", t, func() { "github.com/smartystreets/goconvey/convey"db的mock"github.com/gin-gonic/gin". "github.com/smartystreets/goconvey/convey""github.com/DATA-DOG/go-sqlmock""github.com/jinzhu/gorm"bench

    19210编辑于 2022-07-06
  • 来自专栏golang云原生new

    Golang 单元测试合集整理,(我最常用 gomonkey)欢迎收藏

    这个工具用起来再接下下面的 go convey 真的非常 nice Go Convey 更好的单测框架 集成了 go test,有丰富的断言框架,还有彩色用例结果 Github 地址 https://github.com/smartystreets /goconvey 安装 go get github.com/smartystreets/goconvey 代码中 import c "github.com/smartystreets/goconvey localhost:9999/ 即可看到具体的单测结果,每一个案例都可以看到是成功还是失败,以及失败的原因 当然,关于 go convey 的具体使用细节和进阶,可以查看地址:https://github.com/smartystreets

    2.5K31编辑于 2023-09-14
  • 来自专栏网管叨bi叨

    使用 Go Convey 做BDD测试的入门指南

    goconvey 的安装和基本用法 在项目中使用goconvey 前需要先在项目依赖中添加goconvey,安装命令如下go get github.com/smartystreets/goconvey "github.com/smartystreets/goconvey/convey" ) func TestSpec(t *testing.T) { // Only pass t into top-level "github.com/smartystreets/goconvey/convey",这样是为了方便大家直接使用 goconvey 中的各种定义,无需再像convey.Convey这样加包前缀。

    44110编辑于 2025-02-25
  • 来自专栏我的编码学习笔记

    Go语言单元测试

    go get github.com/smartystreets/goconvey/convey@v1.7.2还是利用上面的例子,将convey和monkey结合起来使用,改造一下上面的例子,将KPI的返回从 "github.com/smartystreets/goconvey/convey")func TestCalcKPI(t *testing.T) {Convey("简单的测试", t, func()

    95020编辑于 2023-03-24
  • 来自专栏程序技术知识

    golang 读写 xlsx 文件

    import ("fmt""github.com/360EntSecGroup-Skylar/excelize""github.com/smartystreets/goconvey/convey""strconv

    1.2K10编辑于 2022-07-08
  • 来自专栏人人都是架构师

    Go单测系列6—goconvey的使用

    安装 go get github.com/smartystreets/goconvey 使用示例 我们使用goconvey来为最开始的基础示例中的Split函数编写单元测试。 result = append(result, s) return } 单元测试文件内容如下: // split_test.go import ( "testing" c "github.com/smartystreets

    68630编辑于 2023-09-10
  • 来自专栏网管叨bi叨

    Go项目实战-学会对代码逻辑层进行BDD测试

    本文大纲如下: goconvey 的 安装命令如下: go get github.com/smartystreets/goconvey 输入命令后,安装过程如下所示: 关于goconvey的使用方法详解 "github.com/smartystreets/goconvey/convey" ) func TestMain(m *testing.M) { // convey在TestMain场景下的入口 "github.com/smartystreets/goconvey/convey",这样是为了方便大家直接使用 convey 包中的各种定义,无需再像 convey.Convey 这样加包前缀。

    36410编辑于 2025-05-15
  • 来自专栏jerryteng的专栏

    Golang单元测试系列-快速上手

    goconvey:github.com/smartystreets/goconvey,用来组织测试用例,提供了很多断言,兼容go test,有 web ui 。

    1.3K20编辑于 2022-06-16
  • 来自专栏山山仙人的专栏

    Golang单元测试

    "github.com/smartystreets/goconvey/convey" "testing" ) func TestNewStudent(t *testing.T) { Convey( PASS: TestScore (0.00s) PASS ok pkg04 0.126s 2.2.2 图形化使用 确保本地有goconvey的二进制 go get github.com/smartystreets

    1K20发布于 2021-08-31
  • 来自专栏技术研究和应用

    快速入门Golang Fuzz模糊测试

    import ( "os" "testing" "github.com/smartystreets/goconvey/convey")// FuzzEncodeJSON fuzzing

    1.6K81编辑于 2022-12-19
  • 来自专栏云端漫步

    go语言学习之开发工具使用(二)

    go-simplejson - package: git.oschina.net/qiangmzsx/beegofreecache testImport: - package: github.com/smartystreets

    1.3K40发布于 2018-10-15
  • golang源码分析:gomonkey

    "github.com/smartystreets/goconvey/convey" ) var ( outputExpect = "xxx-vethName100-yyy" ) func TestApplyFunc

    9710编辑于 2026-03-18
  • 来自专栏火丁笔记

    白话Golang单元测试

    "github.com/smartystreets/goconvey/convey" ) func Test_Live3(t *testing.T) { patches := NewPatches( "github.com/smartystreets/goconvey/convey" ) func Test_Live(t *testing.T) { ctrl := gomock.NewController

    68330编辑于 2021-12-14
  • 来自专栏光城(guangcity)

    优雅的使用Go进行单元测试

    get github.com/prashantv/gostub // monkey go get github.com/bouk/monkey // goconvey go get github.com/smartystreets

    3.4K20发布于 2020-07-20
  • 来自专栏jerryteng的专栏

    Golang单元测试系列-如何更好的写测试用例

    "github.com/smartystreets/goconvey/convey")func TestGetBirthdayFromIdNumber(t *testing.T) {Convey("测试从身份证号获取

    2K40编辑于 2022-06-16
  • 来自专栏stark张宇

    Go - 从0学习Go的第一课

    其他测试继续执行 -v:查看测试结果 -cover:测试代码覆盖率 go test -v -cover type_test.go 2.第三方 BDD框架 项目网站 https://github.com/smartystreets /goconvey 安装 go get -u github.com/smartystreets/goconvey 启动 web Ui $GOPATH/bin/goconvey 反射和UnSafe reflect.TypeOf

    46340编辑于 2023-03-07
  • 来自专栏代码工具

    用redis做一个简单的限流

    "github.com/smartystreets/goconvey/convey""testing")/** * @Description * @Author guirongguo * @Email

    1.5K70编辑于 2022-06-30
  • 来自专栏AI科技大本营的专栏

    Go开发者路线图2019,请收下这份指南

    https://github.com/go-check/check GoDog:https://github.com/DATA-DOG/godog GoConvey:https://github.com/smartystreets

    1.9K52发布于 2019-05-14
领券