package
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Jul 27, 2019
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Fatal(v ...interface{})
Fatal works like log.Fatal but it ensure teardown functions will be
called before exit.
Main should be called from TestMain to ensure Setup and Teardown
functions will be called.
func TestMain(m *testing.M) { testinit.Main(m) }
func Setup(idx int, f func())
Setup let you run test init() functions in defined order.
func init() { testinit.Setup(1, setup) }
func setup() { ... }
Teardown ensure f will be called before exiting from test.
You should always call Main from TestMain and call Fatal instead
of log.Fatal or os.Exit.
If Teardown will be called multiple times then f will be executed in
reverse order - just like defer does.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.