Documentation
¶
Index ¶
- Constants
- func BundleCompare(t *testing.T, bundleExpected, bundleActual *smith_v1.Bundle)
- func BundleCompareContext(t *testing.T, fileName FileName, paramExpected, paramActual *smith_v1.Bundle)
- func ContextWithLogger(t *testing.T) context.Context
- func FileCompare(t *testing.T, expectedFileName, actualFileName FileName, ...) bool
- func JSONCompare(t *testing.T, expectedData, actualData interface{}) bool
- func JSONCompareContext(t *testing.T, expectedFileName FileName, expectedData, actualData interface{}) bool
- func LoadFileFromTestData(filename string) ([]byte, error)
- func LoadIntoStructFromTestData(filename string, obj interface{}) error
- func Named(name string) auth.User
- func ObjectCompare(t *testing.T, resActual, resExpected runtime.Object)
- func ObjectCompareContext(t *testing.T, fileName FileName, paramActual, paramExpected runtime.Object)
- func PluginCompare(t *testing.T, resActual, resExpected *smith_v1.PluginSpec)
- func PluginCompareContext(t *testing.T, fileName FileName, ...)
- func ReadCompare(t *testing.T, expectedFileName, actualFileName FileName, actualData string) bool
- func ResourceCompare(t *testing.T, resActual, resExpected *smith_v1.Resource)
- func ResourceCompareContext(t *testing.T, fileName FileName, paramActual, paramExpected *smith_v1.Resource)
- func TextCompare(t *testing.T, expectedTextName, actualTextName string, ...) bool
- func TextLinesCompare(t *testing.T, expectedTextName, actualTextName string, ...) bool
- func YAMLCompare(t *testing.T, expectedData, actualData interface{}) bool
- func YAMLCompareContext(t *testing.T, expectedFileName FileName, expectedData, actualData interface{}) bool
- type FileName
Constants ¶
View Source
const (
FixturesDir = "testdata"
)
Variables ¶
This section is empty.
Functions ¶
func BundleCompare ¶
func BundleCompareContext ¶
func FileCompare ¶
func FileCompare(t *testing.T, expectedFileName, actualFileName FileName, expectedData, actualData string) bool
functions like assert in that it returns true/false if there is no difference and marks the test as failed while allowing the test to continue
func JSONCompare ¶
Marshals both structs into JSON, compares them and prints text diff between them
func JSONCompareContext ¶
func JSONCompareContext(t *testing.T, expectedFileName FileName, expectedData, actualData interface{}) bool
Marshals both structs into JSON, compares them and prints text diff between them. Accepts expectedFileName to print Unix patch that can be applied on top of the file.
func LoadFileFromTestData ¶
func ObjectCompareContext ¶
func PluginCompare ¶
func PluginCompare(t *testing.T, resActual, resExpected *smith_v1.PluginSpec)
func PluginCompareContext ¶
func PluginCompareContext(t *testing.T, fileName FileName, paramActual, paramExpected *smith_v1.PluginSpec)
func ReadCompare ¶
func ResourceCompare ¶
func ResourceCompareContext ¶
func TextCompare ¶
func TextLinesCompare ¶
func YAMLCompare ¶
Marshals both structs into YAML, compares them and prints text diff between them
func YAMLCompareContext ¶
func YAMLCompareContext(t *testing.T, expectedFileName FileName, expectedData, actualData interface{}) bool
Marshals both structs into YAML, compares them and prints text diff between them. Accepts expectedFileName to print Unix patch that can be applied on top of the file.