|
1 | | -json-patch-tests |
| 1 | +JSON Patch Tests |
2 | 2 | ================ |
3 | 3 |
|
4 | | -Test cases for implementations of json-patch: |
| 4 | +These are test cases for implementations of the [IETF JSON Patch |
| 5 | +draft](http://tools.ietf.org/html/draft-ietf-appsawg-json-patch). |
5 | 6 |
|
6 | | -http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-02 |
7 | 7 |
|
8 | | -Test format |
| 8 | +Test Format |
9 | 9 | ----------- |
10 | 10 |
|
11 | | -The test file contains a list of test records, each with a few |
12 | | -fields that defines a test. |
| 11 | +Each test file is a JSON document that contains an array of test records. A |
| 12 | +test record is an object with the following members: |
13 | 13 |
|
14 | 14 | - doc: The JSON document to test against |
15 | | -- patch: The patch(es) to apply. |
| 15 | +- patch: The patch(es) to apply |
16 | 16 | - expected: The expected resulting document, OR |
17 | 17 | - error: A string describing an expected error |
18 | 18 | - comment: A string describing the test |
19 | | -- disabled: True if the test should be skipped. |
| 19 | +- disabled: True if the test should be skipped |
20 | 20 |
|
21 | | -All fields except 'doc' and 'patch' are optional. Test records consisting only of a comment are also OK. |
| 21 | +All fields except 'doc' and 'patch' are optional. Test records consisting only |
| 22 | +of a comment are also OK. |
22 | 23 |
|
23 | | -This test set is not complete, or even correct - help welcome! |
| 24 | +These tests are not complete, or even correct - help welcome! |
24 | 25 |
|
25 | 26 | Credits |
26 | 27 | ------- |
27 | 28 |
|
28 | | -The seed test set was adapted from https://github.com/bruth/jsonpatch-js/blob/master/test.js . |
29 | | - |
| 29 | +The seed test set was adapted from Byron Ruth's |
| 30 | +[jsonpatch-js](https://github.com/bruth/jsonpatch-js/blob/master/test.js) and |
| 31 | +extended by [Mike McCabe](https://github.com/mikemccabe). |
0 commit comments