Documentation
¶
Index ¶
- func Contains(s, contains interface{}) bool
- func Empty(object interface{}) bool
- func Equal(expected, actual interface{}) bool
- func GetValueFromYAML[T any](data map[string]interface{}, key string) (T, error)
- func NotContains(s, contains interface{}) bool
- func NotEmpty(object interface{}) bool
- func NotEqual(expected, actual interface{}) bool
- func ObjectsAreEqual(expected, actual interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains(s, contains interface{}) bool
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element.
helpers.Contains("Hello World", "World") helpers.Contains(["Hello", "World"], "World") helpers.Contains({"Hello": "World"}, "Hello")
func Empty ¶
func Empty(object interface{}) bool
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0.
helpers.Empty(obj)
func Equal ¶
func Equal(expected, actual interface{}) bool
Equal asserts that two objects are equal.
helpers.Equal(123, 123)
Pointer variable equality is determined based on the equality of the referenced values (as opposed to the memory addresses). Function equality cannot be determined and will always fail.
func GetValueFromYAML ¶
func NotContains ¶
func NotContains(s, contains interface{}) bool
NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element.
helpers.NotContains("Hello World", "Earth") helpers.NotContains(["Hello", "World"], "Earth") helpers.NotContains({"Hello": "World"}, "Earth")
func NotEmpty ¶
func NotEmpty(object interface{}) bool
NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0.
if helpers.NotEmpty(obj) { helpers.Equal("two", obj[1]) }
func NotEqual ¶
func NotEqual(expected, actual interface{}) bool
NotEqual asserts that the specified values are NOT equal.
helpers.NotEqual(obj1, obj2)
Pointer variable equality is determined based on the equality of the referenced values (as opposed to the memory addresses).
func ObjectsAreEqual ¶
func ObjectsAreEqual(expected, actual interface{}) bool
ObjectsAreEqual determines if two objects are considered equal.
This function does no assertion of any kind.
Types ¶
This section is empty.