Fix some json tests

This commit is contained in:
2025-03-25 18:28:40 +01:00
parent db92033642
commit fed140254b
4 changed files with 82 additions and 53 deletions

View File

@@ -123,11 +123,9 @@ func (p *JSONProcessor) ProcessContent(content string, pattern string, luaExpr s
var jsonBytes []byte
jsonBytes, err = json.MarshalIndent(jsonData, "", " ")
if err != nil {
return content, len(nodes), 0, fmt.Errorf("error marshalling JSON: %v", err)
return content, modCount, matchCount, fmt.Errorf("error marshalling JSON: %v", err)
}
// We changed all the nodes trust me bro
return string(jsonBytes), len(nodes), len(nodes), nil
return string(jsonBytes), modCount, matchCount, nil
}
// / Selects from the root node