github.com/Schaudge/grailbase@v0.0.0-20240223061707-44c758a471c0/security/ticket/ticket_test.go (about) 1 // Copyright 2018 GRAIL, Inc. All rights reserved. 2 // Use of this source code is governed by the Apache-2.0 3 // license that can be found in the LICENSE file. 4 5 package ticket 6 7 import ( 8 "reflect" 9 "testing" 10 11 "github.com/Schaudge/grailbase/vcontext" 12 ) 13 14 func TestMerge(t *testing.T) { 15 ctx := &TicketContext{ 16 ctx: vcontext.Background(), 17 } 18 got := mergeOrDie(ctx, &S3Ticket{Endpoint: "xxx"}, &S3Ticket{Bucket: "yyy"}) 19 want := &S3Ticket{ 20 Endpoint: "xxx", 21 Bucket: "yyy", 22 } 23 if !reflect.DeepEqual(got, want) { 24 t.Errorf("got %+v, want %+v", got, want) 25 } 26 }