Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Contains check.Checker = &containsChecker{ &check.CheckerInfo{Name: "Contains", Params: []string{"container", "elem"}}, }
Contains is a Checker that looks for a elem in a container. The elem can be any object. The container can be an array, slice or string.
var DeepContains check.Checker = &deepContainsChecker{ &check.CheckerInfo{Name: "DeepContains", Params: []string{"container", "elem"}}, }
DeepContains is a Checker that looks for a elem in a container using DeepEqual. The elem can be any object. The container can be an array, slice or string.
var FileAbsent check.Checker = &filePresenceChecker{ CheckerInfo: &check.CheckerInfo{Name: "FileAbsent", Params: []string{"filename"}}, present: false, }
FileAbsent verifies that the given file does not exist.
var FileContains check.Checker = &fileContentChecker{ CheckerInfo: &check.CheckerInfo{Name: "FileContains", Params: []string{"filename", "contents"}}, }
FileContains verifies that the given file's content contains the string (or fmt.Stringer) or []byte provided.
var FileEquals check.Checker = &fileContentChecker{ CheckerInfo: &check.CheckerInfo{Name: "FileEquals", Params: []string{"filename", "contents"}}, exact: true, }
FileEquals verifies that the given file's content is equal to the string (or fmt.Stringer) or []byte provided.
var FileMatches check.Checker = &fileContentChecker{ CheckerInfo: &check.CheckerInfo{Name: "FileMatches", Params: []string{"filename", "regex"}}, }
FileMatches verifies that the given file's content matches the string provided.
var FilePresent check.Checker = &filePresenceChecker{ CheckerInfo: &check.CheckerInfo{Name: "FilePresent", Params: []string{"filename"}}, present: true, }
FilePresent verifies that the given file exists.
var IntEqual = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntEqual", Params: []string{"a", "b"}}, rel: "=="}
IntEqual checker verifies that one integer is equal to other integer.
For example:
c.Assert(1, IntEqual, 1)
var IntGreaterEqual = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntGreaterEqual", Params: []string{"a", "b"}}, rel: ">="}
IntGreaterEqual checker verifies that one integer is greater than or equal to other integer.
For example:
c.Assert(1, IntGreaterEqual, 2)
var IntGreaterThan = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntGreaterThan", Params: []string{"a", "b"}}, rel: ">"}
IntGreaterThan checker verifies that one integer is greater than other integer.
For example:
c.Assert(2, IntGreaterThan, 1)
var IntLessEqual = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntLessEqual", Params: []string{"a", "b"}}, rel: "<="}
IntLessEqual checker verifies that one integer is less than or equal to other integer.
For example:
c.Assert(1, IntLessEqual, 1)
var IntLessThan = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntLessThan", Params: []string{"a", "b"}}, rel: "<"}
IntLessThan checker verifies that one integer is less than other integer.
For example:
c.Assert(1, IntLessThan, 2)
var IntNotEqual = &intChecker{CheckerInfo: &check.CheckerInfo{Name: "IntNotEqual", Params: []string{"a", "b"}}, rel: "!="}
IntNotEqual checker verifies that one integer is not equal to other integer.
For example:
c.Assert(1, IntNotEqual, 2)
Functions ¶
This section is empty.
Types ¶
type BaseTest ¶
type BaseTest struct {
// contains filtered or unexported fields
}
BaseTest is a structure used as a base test suite for many of the pebble tests.
func (*BaseTest) AddCleanup ¶
func (s *BaseTest) AddCleanup(f func())
AddCleanup adds a new cleanup function to the test
func (*BaseTest) SetUpTest ¶
func (s *BaseTest) SetUpTest(c *check.C)
SetUpTest prepares the cleanup
func (*BaseTest) TearDownTest ¶
func (s *BaseTest) TearDownTest(c *check.C)
TearDownTest cleans up the channel.ini files in case they were changed by the test. It also runs the cleanup handlers
type FakeCmd ¶
type FakeCmd struct {
// contains filtered or unexported fields
}
FakeCmd allows faking commands for testing.
func FakeCommand ¶
FakeCommand adds a faked command. If the basename argument is a command it is added to PATH. If it is an absolute path it is just created there. the caller is responsible for the cleanup in this case.
The command logs all invocations to a dedicated log file. If script is non-empty then it is used as is and the caller is responsible for how the script behaves (exit code and any extra behavior). If script is empty then the command exits successfully without any other side-effect.
func (*FakeCmd) Also ¶
Also fake this command, using the same bindir and log. Useful when you want to check the ordering of things.
func (*FakeCmd) Calls ¶
Calls returns a list of calls that were made to the fake command. of the form:
[][]string{ {"cmd", "arg1", "arg2"}, // first invocation of "cmd" {"cmd", "arg1", "arg2"}, // second invocation of "cmd" }
func (*FakeCmd) ForgetCalls ¶
func (cmd *FakeCmd) ForgetCalls()
ForgetCalls purges the list of calls made so far