Add missing tests and models for json-patch

This commit is contained in:
Chris Smowton
2023-03-23 17:42:59 +00:00
parent 5e74930881
commit 803b9d38cc
3 changed files with 29 additions and 0 deletions

View File

@@ -11,3 +11,7 @@ extensions:
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "Apply", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndent", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndent", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyWithOptions", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyWithOptions", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndentWithOptions", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndentWithOptions", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]

View File

@@ -61,4 +61,18 @@ func main() {
b11, _ := getTaintedPatch().ApplyIndent(untaintedByteArray, " ")
sinkByteArray(b11) // $ taintflow
// func (p Patch) ApplyWithOptions(doc []byte, options *ApplyOptions) ([]byte, error)
b12, _ := untaintedPatch.ApplyWithOptions(getTaintedByteArray(), nil)
sinkByteArray(b12) // $ taintflow
b13, _ := getTaintedPatch().ApplyWithOptions(untaintedByteArray, nil)
sinkByteArray(b13) // $ taintflow
// func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyOptions) ([]byte, error)
b14, _ := untaintedPatch.ApplyIndentWithOptions(getTaintedByteArray(), " ", nil)
sinkByteArray(b14) // $ taintflow
b15, _ := getTaintedPatch().ApplyIndentWithOptions(untaintedByteArray, " ", nil)
sinkByteArray(b15) // $ taintflow
}

View File

@@ -54,3 +54,14 @@ func (_ Patch) Apply(_ []byte) ([]byte, error) {
func (_ Patch) ApplyIndent(_ []byte, _ string) ([]byte, error) {
return nil, nil
}
type ApplyOptions struct {
}
func (_ Patch) ApplyWithOptions(_ []byte, _ *ApplyOptions) ([]byte, error) {
return nil, nil
}
func (_ Patch) ApplyIndentWithOptions(_ []byte, _ string, _ *ApplyOptions) ([]byte, error) {
return nil, nil
}