Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should test parent/child copy/move operations #41

Open
bbarry opened this issue May 13, 2019 · 0 comments
Open

should test parent/child copy/move operations #41

bbarry opened this issue May 13, 2019 · 0 comments

Comments

@bbarry
Copy link

bbarry commented May 13, 2019

What should happen when an element is copied/moved to its own ancestor/descendant?

    { "doc": [],
      "patch": [{"op": "copy", "from": "/", "path": "/-"}],
      "expected": [[]],
      "comment": "copy should work when path is compatible descendant of from"},
    { "doc": [[1]],
      "patch": [{"op": "copy", "from": "/0/0", "path": "/-"}],
      "expected": [[1],1],
      "comment": "copy should work when from is compatible descendant of path"},
    { "doc": [[1]],
      "patch": [{"op": "move", "from": "/0/0", "path": "/-"}],
      "expected": [1],
      "comment": "move should work when from is compatible descendant of path"},
    { "doc": {"foo": {}},
      "patch": [{"op": "copy", "from": "/foo", "path": "/foo/bar"}],
      "expected": {"foo": {"bar": {}}},
      "comment": "copy should work when path is compatible descendant of from"},
    { "doc": {"foo": {"bar": {"baz": null}}},
      "patch": [{"op": "copy", "from": "/foo/bar", "path": "/foo"}],
      "expected": {"foo": {"bar": {"baz": null}, "baz": null}},
      "comment": "copy should work when from is compatible descendant of path"},
    { "doc": {"foo": {"bar": {"baz": null}}},
      "patch": [{"op": "move", "from": "/foo/bar", "path": "/foo"}],
      "expected": {"foo": {"baz": null}},
      "comment": "move should work when from is compatible descendant of path"},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant