@@ -127,16 +127,16 @@ func TestRawRequests(t *testing.T) {
127
127
}
128
128
}
129
129
130
- t .Run ("inc" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "params": [], "id": 1}` , `{"jsonrpc":"2.0","id":1}` , 1 , 200 ))
131
- t .Run ("inc-null" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "params": null, "id": 1}` , `{"jsonrpc":"2.0","id":1}` , 1 , 200 ))
132
- t .Run ("inc-noparam" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "id": 2}` , `{"jsonrpc":"2.0","id":2}` , 1 , 200 ))
133
- t .Run ("add" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [10], "id": 4}` , `{"jsonrpc":"2.0","id":4}` , 10 , 200 ))
130
+ t .Run ("inc" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "params": [], "id": 1}` , `{"jsonrpc":"2.0","id":1,"result":null }` , 1 , 200 ))
131
+ t .Run ("inc-null" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "params": null, "id": 1}` , `{"jsonrpc":"2.0","id":1,"result":null }` , 1 , 200 ))
132
+ t .Run ("inc-noparam" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Inc", "id": 2}` , `{"jsonrpc":"2.0","id":2,"result":null }` , 1 , 200 ))
133
+ t .Run ("add" , tc (`{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [10], "id": 4}` , `{"jsonrpc":"2.0","id":4,"result":null }` , 10 , 200 ))
134
134
// Batch requests
135
135
t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 5}` , `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}}` , 0 , 500 ))
136
- t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 6}]` , `[{"jsonrpc":"2.0","id":6}]` , 123 , 200 ))
137
- t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 7},{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [-122], "id": 8}]` , `[{"jsonrpc":"2.0","id":7},{"jsonrpc":"2.0","id":8}]` , 1 , 200 ))
138
- t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 9},{"jsonrpc": "2.0", "params": [-122], "id": 10}]` , `[{"jsonrpc":"2.0","id":9},{"error":{"code":-32601,"message":"method '' not found"},"id":10,"jsonrpc":"2.0"}]` , 123 , 200 ))
139
- t .Run ("add" , tc (` [{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [-1], "id": 11}] ` , `[{"jsonrpc":"2.0","id":11}]` , - 1 , 200 ))
136
+ t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 6}]` , `[{"jsonrpc":"2.0","id":6,"result":null }]` , 123 , 200 ))
137
+ t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 7},{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [-122], "id": 8}]` , `[{"jsonrpc":"2.0","id":7,"result":null },{"jsonrpc":"2.0","id":8,"result":null }]` , 1 , 200 ))
138
+ t .Run ("add" , tc (`[{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [123], "id": 9},{"jsonrpc": "2.0", "params": [-122], "id": 10}]` , `[{"jsonrpc":"2.0","id":9,"result":null },{"error":{"code":-32601,"message":"method '' not found"},"id":10,"jsonrpc":"2.0"}]` , 123 , 200 ))
139
+ t .Run ("add" , tc (` [{"jsonrpc": "2.0", "method": "SimpleServerHandler.Add", "params": [-1], "id": 11}] ` , `[{"jsonrpc":"2.0","id":11,"result":null }]` , - 1 , 200 ))
140
140
t .Run ("add" , tc (`` , `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid request"}}` , 0 , 400 ))
141
141
}
142
142
0 commit comments