• Home
Name Date Size #Lines LOC

..--

.editorconfigD07-Sep-2024183 118

.gitignoreD07-Sep-202434 54

.npmignoreD07-Sep-202425 32

README.mdD07-Sep-20242.3 KiB7650

cjson-utils-tests.jsonD07-Sep-20242.6 KiB9290

package.jsonD07-Sep-2024393 1615

spec_tests.jsonD07-Sep-20243.9 KiB234215

tests.jsonD07-Sep-202416.8 KiB465376

README.md

1JSON Patch Tests
2================
3
4These are test cases for implementations of [IETF JSON Patch (RFC6902)](http://tools.ietf.org/html/rfc6902).
5
6Some implementations can be found at [jsonpatch.com](http://jsonpatch.com).
7
8
9Test Format
10-----------
11
12Each test file is a JSON document that contains an array of test records. A
13test 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
22All fields except 'doc' and 'patch' are optional. Test records consisting only
23of a comment are also OK.
24
25
26Files
27-----
28
29- tests.json: the main test file
30- spec_tests.json: tests from the RFC6902 spec
31
32
33Writing Tests
34-------------
35
36All tests should have a descriptive comment.  Tests should be as
37simple as possible - just what's required to test a specific piece of
38behavior.  If you want to test interacting behaviors, create tests for
39each behavior as well as the interaction.
40
41If an 'error' member is specified, the error text should describe the
42error the implementation should raise - *not* what's being tested.
43Implementation error strings will vary, but the suggested error should
44be easily matched to the implementation error string.  Try to avoid
45creating error tests that might pass because an incorrect error was
46reported.
47
48Please feel free to contribute!
49
50
51Credits
52-------
53
54The seed test set was adapted from Byron Ruth's
55[jsonpatch-js](https://github.com/bruth/jsonpatch-js/blob/master/test.js) and
56extended by [Mike McCabe](https://github.com/mikemccabe).
57
58
59License
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
76