xtest

package
Version: v0.0.0-...-c8fc2fc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package xtest adds support for assertions in multiple goroutines to Goconvey.

Parallel goconvey blocks cannot contain other goconvey blocks.

Example:

func TestParallel(t *testing.T) {
  Convey("Test parallel goroutines", t, Parallel(func(sc *SC) {
    x := 1
    sc.SoMsg("x", x, ShouldEqual, 1)
  }, func(sc *SC) {
    y := 1
    sc.SoMsg("y", y, ShouldEqual, 1)
  }))
}

Note that inside parallel blocks, Convey methods should be explicitly invoked on the local convey object (e.g., sc).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parallel

func Parallel(f, g func(sc *SC)) func(c C)

Types

type SC

type SC struct {
	C
	sync.WaitGroup
	sync.Mutex
}

func (*SC) Convey

func (c *SC) Convey(items ...interface{})

func (*SC) Recover

func (c *SC) Recover()

func (*SC) So

func (c *SC) So(actual interface{},
	assert func(actual interface{}, expected ...interface{}) string, expected ...interface{})

func (*SC) SoMsg

func (c *SC) SoMsg(msg string, actual interface{},
	assert func(actual interface{}, expected ...interface{}) string, expected ...interface{})

Source Files

Directories

Path Synopsis
Package loopback defines a net.PacketConn implementation where sent messages are echoed back on the same connection.
Package loopback defines a net.PacketConn implementation where sent messages are echoed back on the same connection.
Package p2p (point to point) defines a net.PacketConn implementation where messages are exchanged via channels.
Package p2p (point to point) defines a net.PacketConn implementation where messages are exchanged via channels.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL