Documentation ¶
Index ¶
- func AssertJSONEquals(t Testing, expected, actual string, strict bool)
- func AssertJSONNotEquals(t Testing, expected, actual string, strict bool)
- type DefaultComparator
- func (comp *DefaultComparator) CheckJsonObjectKeysActualInExpected(prefix string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) CheckJsonObjectKeysExpectedInActual(prefix string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) CompareJSONArray(expected, actual JSONNode) *JSONCompareResult
- func (comp *DefaultComparator) CompareJSONArrayWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) CompareJSONArrayWithStrictOrder(key string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) CompareJSONObject(expected, actual JSONNode) *JSONCompareResult
- func (comp *DefaultComparator) CompareJSONObjectWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) CompareValues(prefix string, expected, actual interface{}, result *JSONCompareResult)
- func (comp *DefaultComparator) CompareValuesJSONNode(prefix string, expected, actual JSONNode, result *JSONCompareResult)
- func (comp *DefaultComparator) RecursivelyCompareJSONArray(key string, expected, actual JSONNode, result *JSONCompareResult)
- type JSONAssertMatcher
- type JSONComparator
- type JSONCompare
- type JSONCompareMode
- type JSONCompareResult
- func (res *JSONCompareResult) Fail(prefix string, expected interface{}, actual interface{})
- func (res *JSONCompareResult) FailWithMessage(message string)
- func (res *JSONCompareResult) Failed() bool
- func (res *JSONCompareResult) GetMessage() string
- func (res *JSONCompareResult) Missing(field string, object interface{})
- func (res *JSONCompareResult) Passed() bool
- func (res *JSONCompareResult) Unexpected(message string, object interface{})
- type JSONNode
- type SimpleJSONNode
- func (s *SimpleJSONNode) CheckGet(key string) (JSONNode, bool)
- func (s *SimpleJSONNode) GetArray() []interface{}
- func (s *SimpleJSONNode) GetData() interface{}
- func (s *SimpleJSONNode) GetMap() map[string]interface{}
- func (s *SimpleJSONNode) GetSize() int
- func (s *SimpleJSONNode) IsArray() bool
- func (s *SimpleJSONNode) IsMap() bool
- func (s *SimpleJSONNode) Set(key string, value interface{})
- func (s *SimpleJSONNode) SetArray(array []interface{})
- func (s *SimpleJSONNode) SetData(data interface{})
- func (s *SimpleJSONNode) String() string
- type Testing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertJSONEquals ¶
func AssertJSONNotEquals ¶
Types ¶
type DefaultComparator ¶
type DefaultComparator struct {
// contains filtered or unexported fields
}
func (*DefaultComparator) CheckJsonObjectKeysActualInExpected ¶
func (comp *DefaultComparator) CheckJsonObjectKeysActualInExpected(prefix string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) CheckJsonObjectKeysExpectedInActual ¶
func (comp *DefaultComparator) CheckJsonObjectKeysExpectedInActual(prefix string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) CompareJSONArray ¶
func (comp *DefaultComparator) CompareJSONArray(expected, actual JSONNode) *JSONCompareResult
func (*DefaultComparator) CompareJSONArrayWithPrefix ¶
func (comp *DefaultComparator) CompareJSONArrayWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) CompareJSONArrayWithStrictOrder ¶
func (comp *DefaultComparator) CompareJSONArrayWithStrictOrder(key string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) CompareJSONObject ¶
func (comp *DefaultComparator) CompareJSONObject(expected, actual JSONNode) *JSONCompareResult
func (*DefaultComparator) CompareJSONObjectWithPrefix ¶
func (comp *DefaultComparator) CompareJSONObjectWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) CompareValues ¶
func (comp *DefaultComparator) CompareValues(prefix string, expected, actual interface{}, result *JSONCompareResult)
func (*DefaultComparator) CompareValuesJSONNode ¶
func (comp *DefaultComparator) CompareValuesJSONNode(prefix string, expected, actual JSONNode, result *JSONCompareResult)
func (*DefaultComparator) RecursivelyCompareJSONArray ¶
func (comp *DefaultComparator) RecursivelyCompareJSONArray(key string, expected, actual JSONNode, result *JSONCompareResult)
type JSONAssertMatcher ¶
type JSONAssertMatcher struct {
// contains filtered or unexported fields
}
func LenientlyMatchJSON ¶
func LenientlyMatchJSON(expected interface{}) *JSONAssertMatcher
func StrictlyMatchJSON ¶
func StrictlyMatchJSON(expected interface{}) *JSONAssertMatcher
func (*JSONAssertMatcher) FailureMessage ¶
func (m *JSONAssertMatcher) FailureMessage(actual interface{}) (message string)
func (*JSONAssertMatcher) Match ¶
func (m *JSONAssertMatcher) Match(actual interface{}) (success bool, err error)
func (*JSONAssertMatcher) NegatedFailureMessage ¶
func (m *JSONAssertMatcher) NegatedFailureMessage(actual interface{}) (message string)
type JSONComparator ¶
type JSONComparator interface { CompareJSONObject(expected, actual JSONNode) *JSONCompareResult CompareJSONArray(expected, actual JSONNode) *JSONCompareResult CompareJSONObjectWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult) CompareJSONArrayWithPrefix(prefix string, expected, actual JSONNode, result *JSONCompareResult) CompareValues(prefix string, expected interface{}, actual interface{}, result *JSONCompareResult) }
type JSONCompare ¶
type JSONCompare struct { }
func NewJSONCompare ¶
func NewJSONCompare() JSONCompare
func (JSONCompare) CompareJSON ¶
func (comp JSONCompare) CompareJSON(expectedStr string, actualStr string, compareMode JSONCompareMode) *JSONCompareResult
type JSONCompareMode ¶
type JSONCompareMode int
const ( STRICT JSONCompareMode = iota LENIENT NON_EXTENSIBLE STRICT_ORDER )
type JSONCompareResult ¶
type JSONCompareResult struct {
// contains filtered or unexported fields
}
func NewJSONCompareResult ¶
func NewJSONCompareResult() *JSONCompareResult
func (*JSONCompareResult) Fail ¶
func (res *JSONCompareResult) Fail(prefix string, expected interface{}, actual interface{})
func (*JSONCompareResult) FailWithMessage ¶
func (res *JSONCompareResult) FailWithMessage(message string)
func (*JSONCompareResult) Failed ¶
func (res *JSONCompareResult) Failed() bool
func (*JSONCompareResult) GetMessage ¶
func (res *JSONCompareResult) GetMessage() string
func (*JSONCompareResult) Missing ¶
func (res *JSONCompareResult) Missing(field string, object interface{})
func (*JSONCompareResult) Passed ¶
func (res *JSONCompareResult) Passed() bool
func (*JSONCompareResult) Unexpected ¶
func (res *JSONCompareResult) Unexpected(message string, object interface{})
type JSONNode ¶
type JSONNode interface { IsMap() bool IsArray() bool GetData() interface{} SetData(data interface{}) SetArray(array []interface{}) GetArray() []interface{} GetSize() int GetMap() map[string]interface{} CheckGet(key string) (JSONNode, bool) Set(key string, value interface{}) String() string }
func NewJSONNode ¶
func NewJSONNode() JSONNode
func NewJSONNodeFromArray ¶
func NewJSONNodeFromArray(array []interface{}) JSONNode
func NewJSONNodeFromMap ¶
func NewJSONNodeFromString ¶
type SimpleJSONNode ¶
type SimpleJSONNode struct {
// contains filtered or unexported fields
}
func (*SimpleJSONNode) GetArray ¶
func (s *SimpleJSONNode) GetArray() []interface{}
func (*SimpleJSONNode) GetData ¶
func (s *SimpleJSONNode) GetData() interface{}
func (*SimpleJSONNode) GetMap ¶
func (s *SimpleJSONNode) GetMap() map[string]interface{}
func (*SimpleJSONNode) GetSize ¶
func (s *SimpleJSONNode) GetSize() int
func (*SimpleJSONNode) IsArray ¶
func (s *SimpleJSONNode) IsArray() bool
func (*SimpleJSONNode) IsMap ¶
func (s *SimpleJSONNode) IsMap() bool
func (*SimpleJSONNode) Set ¶
func (s *SimpleJSONNode) Set(key string, value interface{})
func (*SimpleJSONNode) SetArray ¶
func (s *SimpleJSONNode) SetArray(array []interface{})
func (*SimpleJSONNode) SetData ¶
func (s *SimpleJSONNode) SetData(data interface{})
func (*SimpleJSONNode) String ¶
func (s *SimpleJSONNode) String() string
Click to show internal directories.
Click to hide internal directories.