improve body contains check
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-03 15:42:25 +11:00
parent af7ee7f3c1
commit b2519287ef
8 changed files with 148 additions and 62 deletions

17
main.go
View File

@@ -53,12 +53,14 @@ func main() {
if !success {
fmt.Printf("Test result failed\n")
os.Exit(1)
} else {
fmt.Printf("Tests successful\n")
}
}
// For debugging, just dump the output
fmt.Printf("%+v\n", testDefinitions)
//fmt.Printf("%+v\n", testDefinitions)
}
// fileExists returns true if the specified file exists and is not a directory
@@ -92,27 +94,16 @@ func OrderedToStringMap(input orderedmap.OrderedMap) map[string]string {
func OrderedToStringSlice(input []interface{}) []string {
result := []string{}
//vs := testsInterface.([]interface{})
//fmt.Printf("Listing %d test definitions\n", len(vs))
for i := range input {
//fmt.Printf("Reading '%s'\n", input[i])
switch vType := input[i].(type) {
// TODO : more types
case string:
result = append(result, input[i].(string))
default:
fmt.Printf("OrderedToStringSlice received unexpected value type, %T\n", vType)
}
/*
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])
}
*/
}
return result