more random functions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-10 13:01:59 +10:00
parent 6e17210e00
commit d658a46a3f
2 changed files with 85 additions and 0 deletions

View File

@@ -196,6 +196,29 @@ func RunTest(testCase *TestCase) error {
}
}
for k, v := range captureData.Header.Data {
fmt.Printf("Searching header response for match on capture string '%s'\n", k)
results := findKey(k, testCase.ResultBodyMap)
//fmt.Printf("Results : '%v'\n", results)
if len(results) > 0 {
//fmt.Printf("Found %d results but only storing the first one\n", len(results))
// Get the type of the first element
valueType := reflect.TypeOf(results[0])
// Check if the type is not string
if valueType.Kind() != reflect.String {
// Convert the value to string
results[0] = fmt.Sprintf("%v", results[0])
}
fmt.Printf("Storing capture '%s' = '%s'\n", k, results[0].(string))
captureValues.Data[v] = results[0].(string)
}
}
// Capture anything needed
break
}