github.com/aavshr/aws-sdk-go@v1.41.3/aws/request/request_internal_test.go (about) 1 package request 2 3 import ( 4 "testing" 5 ) 6 7 func TestCopy(t *testing.T) { 8 handlers := Handlers{} 9 op := &Operation{} 10 op.HTTPMethod = "Foo" 11 req := &Request{} 12 req.Operation = op 13 req.Handlers = handlers 14 15 r := req.copy() 16 17 if r == req { 18 t.Fatal("expect request pointer copy to be different") 19 } 20 if r.Operation == req.Operation { 21 t.Errorf("expect request operation pointer to be different") 22 } 23 24 if e, a := req.Operation.HTTPMethod, r.Operation.HTTPMethod; e != a { 25 t.Errorf("expect %q http method, got %q", e, a) 26 } 27 }