mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Mark test helpers as such
This commit is contained in:
parent
8072e66d46
commit
56a0771cd1
@ -41,19 +41,21 @@ func parseData(rawData string) yaml.MapSlice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func assertResult(t *testing.T, expectedValue interface{}, actualValue interface{}) {
|
func assertResult(t *testing.T, expectedValue interface{}, actualValue interface{}) {
|
||||||
|
t.Helper()
|
||||||
if expectedValue != actualValue {
|
if expectedValue != actualValue {
|
||||||
t.Error("Expected <", expectedValue, "> but got <", actualValue, ">", fmt.Sprintf("%T", actualValue))
|
t.Error("Expected <", expectedValue, "> but got <", actualValue, ">", fmt.Sprintf("%T", actualValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func assertResultComplex(t *testing.T, expectedValue interface{}, actualValue interface{}) {
|
func assertResultComplex(t *testing.T, expectedValue interface{}, actualValue interface{}) {
|
||||||
|
t.Helper()
|
||||||
if !reflect.DeepEqual(expectedValue, actualValue) {
|
if !reflect.DeepEqual(expectedValue, actualValue) {
|
||||||
t.Error("Expected <", expectedValue, "> but got <", actualValue, ">", fmt.Sprintf("%T", actualValue))
|
t.Error("Expected <", expectedValue, "> but got <", actualValue, ">", fmt.Sprintf("%T", actualValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func assertResultWithContext(t *testing.T, expectedValue interface{}, actualValue interface{}, context interface{}) {
|
func assertResultWithContext(t *testing.T, expectedValue interface{}, actualValue interface{}, context interface{}) {
|
||||||
|
t.Helper()
|
||||||
if expectedValue != actualValue {
|
if expectedValue != actualValue {
|
||||||
t.Error(context)
|
t.Error(context)
|
||||||
t.Error(": expected <", expectedValue, "> but got <", actualValue, ">")
|
t.Error(": expected <", expectedValue, "> but got <", actualValue, ">")
|
||||||
|
Loading…
Reference in New Issue
Block a user