@@ -127,16 +127,16 @@ func TestRawRequests(t *testing.T) {
127127 }
128128 }
129129
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 ))
134134 // Batch requests
135135 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 ))
140140 t .Run ("add" , tc (`` , `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid request"}}` , 0 , 400 ))
141141}
142142
0 commit comments