Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cJSON/blob/master/tests/json-patch-tests/README.md # cJSON [Ported from github.com/DaveGamble/cJSON] Fix: heap-use-after-free in merge_patch when patch is subtree of target (#1065) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `cJSON / tests / json-patch-tests / README.md` 75 lines ยท 2306 bytes Raw Blame History Rendered 1 JSON Patch Tests 2 ================ 3 4 These are test cases for implementations of [IETF JSON Patch (RFC6902)](http://tools.ietf.org/html/rfc6902). 5 6 Some implementations can be found at [jsonpatch.com](http://jsonpatch.com). 7 8 9 Test Format 10 ----------- 11 12 Each test file is a JSON document that contains an array of test records. A 13 test record is an object with the following members: 14 15 - doc: The JSON document to test against 16 - patch: The patch(es) to apply 17 - expected: The expected resulting document, OR 18 - error: A string describing an expected error 19 - comment: A string describing the test 20 - disabled: True if the test should be skipped 21 22 All fields except 'doc' and 'patch' are optional. Test records consisting only 23 of a comment are also OK. 24 25 26 Files 27 ----- 28 29 - tests.json: the main test file 30 - spec_tests.json: tests from the RFC6902 spec 31 32 33 Writing Tests 34 ------------- 35 36 All tests should have a descriptive comment. Tests should be as 37 simple as possible - just what's required to test a specific piece of 38 behavior. If you want to test interacting behaviors, create tests for 39 each behavior as well as the interaction. 40 41 If an 'error' member is specified, the error text should describe the 42 error the implementation should raise - *not* what's being tested. 43 Implementation error strings will vary, but the suggested error should 44 be easily matched to the implementation error string. Try to avoid 45 creating error tests that might pass because an incorrect error was 46 reported. 47 48 Please feel free to contribute! 49 50 51 Credits 52 ------- 53 54 The seed test set was adapted from Byron Ruth's 55 [jsonpatch-js](https://github.com/bruth/jsonpatch-js/blob/master/test.js) and 56 extended by [Mike McCabe](https://github.com/mikemccabe). 57 58 59 License 60 ------- 61 62 Copyright 2014 The Authors 63 64 Licensed under the Apache License, Version 2.0 (the "License"); 65 you may not use this file except in compliance with the License. 66 You may obtain a copy of the License at 67 68 http://www.apache.org/licenses/LICENSE-2.0 69 70 Unless required by applicable law or agreed to in writing, software 71 distributed under the License is distributed on an "AS IS" BASIS, 72 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 73 See the License for the specific language governing permissions and 74 limitations under the License. 75