Skip to content

Commit

Permalink
Add a test case for a negative-value numeric request ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Aug 9, 2021
1 parent be5d2d4 commit 92fcb99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jrpc2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ func TestOtherClient(t *testing.T) {
// A batch of correct requests.
{`[{"jsonrpc":"2.0", "id":"a1", "method":"X"}, {"jsonrpc":"2.0", "id":"a2", "method": "X"}]`,
`[{"jsonrpc":"2.0","id":"a1","result":"OK"},{"jsonrpc":"2.0","id":"a2","result":"OK"}]`},
{`{"jsonrpc":"2.0", "id":-25, "method":"X"}`, `{"jsonrpc":"2.0","id":-25,"result":"OK"}`},

// Extra fields on an otherwise-correct request.
{`{"jsonrpc":"2.0","id": 7, "method": "Z", "params":[], "bogus":true}`,
Expand Down

0 comments on commit 92fcb99

Please sign in to comment.