You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
364 B

package jsonrpc
import (
"context"
"testing"
"github.com/intel-go/fastjson"
"github.com/stretchr/testify/require"
)
func TestRequestID(t *testing.T) {
c := context.Background()
id := fastjson.RawMessage("1")
c = WithRequestID(c, &id)
var pick *fastjson.RawMessage
require.NotPanics(t, func() {
pick = RequestID(c)
})
require.Equal(t, &id, pick)
}