improve body contains check
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -56,30 +56,6 @@ func ReadInput(data []byte, testDefinitions *TestDefinitions) {
|
||||
panic("No key defining test cases found\n")
|
||||
}
|
||||
|
||||
/*
|
||||
// Test Cases is an array, need to go one level down before we start looking at key/values
|
||||
vs := testsInterface.([]interface{})
|
||||
fmt.Printf("Listing %d test definitions\n", len(vs))
|
||||
for i, vInterface := range vs {
|
||||
v := vInterface.(orderedmap.OrderedMap)
|
||||
keys := v.Keys()
|
||||
fmt.Printf("Test %d\n", i)
|
||||
for j := range keys {
|
||||
fmt.Printf("[%d] : %s\n", j, keys[j])
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
vslice := testsInterface.([]interface{})
|
||||
vmap := vslice[2].(orderedmap.OrderedMap)
|
||||
k := vmap.Keys()
|
||||
for i := range k {
|
||||
fmt.Printf("[%d] : %s\n", i, k[i])
|
||||
}
|
||||
return
|
||||
*/
|
||||
|
||||
// Process the "capture" settings that allow us to use values from one test case in subsequent test cases
|
||||
// each capture node has a name that links it to the test case that captures that data
|
||||
if capture, ok := o.Get("capture"); ok {
|
||||
@@ -255,12 +231,8 @@ func ReadBodyTestCases(input orderedmap.OrderedMap, result *BodyTests) {
|
||||
// Has Keys check
|
||||
if val, ok := input.Get("hasKeys"); ok {
|
||||
// This is an array not a map
|
||||
|
||||
hasKeysArray := val.([]interface{})
|
||||
result.HasKeys = OrderedToStringSlice(hasKeysArray)
|
||||
|
||||
//equalsMap := val.(orderedmap.OrderedMap)
|
||||
//result.HasKeys = OrderedToStringMap(equalsMap)
|
||||
}
|
||||
|
||||
// TODO : remaining tests
|
||||
|
Reference in New Issue
Block a user