Skip to content

Commit

Permalink
Expect voids for deleting internally.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephburnett committed Jun 21, 2022
1 parent 52900a7 commit 61a069b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions lib/bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ func TestBoolPatch(t *testing.T) {
checkPatch(ctx, `true`, `false`,
`@ [["MERGE"]]`,
`+ false`)

// Null deletes a node
checkPatch(ctx, `true`, ``,
`@ [["MERGE"]]`,
`+ null`)
`+`)
}

func TestBoolPatchError(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions lib/null_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ func TestNullPatch(t *testing.T) {
checkPatch(ctx, ``, `null`,
`@ []`,
`+ null`)
// Null deletes a node
checkPatch(ctx, `null`, ``,
`@ [["MERGE"]]`,
`+ null`)
`+`)
}

func TestNullPatchError(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions lib/number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ func TestNumberPatch(t *testing.T) {
checkPatch(ctx, `0`, `1`,
`@ [["MERGE"]]`,
`+ 1`)

// Null deletes a node
checkPatch(ctx, `1`, ``,
`@ [["MERGE"]]`,
`+ null`)
`+`)
}

func TestNumberPatchError(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions lib/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ func TestStringPatch(t *testing.T) {
checkPatch(ctx, `"def"`, `"abc"`,
`@ [["MERGE"]]`,
`+ "abc"`)

// Null deletes a node
checkPatch(ctx, `"abc"`, ``,
`@ [["MERGE"]]`,
`+ null`)
`+`)
}

func TestStringPatchError(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions lib/void_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ func TestVoidPatch(t *testing.T) {
checkPatch(ctx, ``, `1`,
`@ [["MERGE"]]`,
`+ 1`)
// Null deletes a node
checkPatch(ctx, ``, ``,
`@ [["MERGE"]]`,
`+ null`)
`+`)
}

func TestVoidPatchError(t *testing.T) {
Expand Down

0 comments on commit 61a069b

Please sign in to comment.