@@ -331,7 +331,7 @@ func TestEcdsaSign(t *testing.T) {
331331 assert .Equal (t , acceptedKeys [0 ].KeyID , keyID , "unexpected keyid" )
332332}
333333
334- func TestB64Decode (t * testing.T ) {
334+ func TestDecodeB64Payload (t * testing.T ) {
335335 var want = make ([]byte , 256 )
336336 for i := range want {
337337 want [i ] = byte (i )
@@ -342,23 +342,35 @@ func TestB64Decode(t *testing.T) {
342342 var b64StdErr = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w"
343343
344344 t .Run ("Standard encoding" , func (t * testing.T ) {
345- got , err := b64Decode (b64Std )
345+ env := & Envelope {
346+ Payload : b64Std ,
347+ }
348+ got , err := env .DecodeB64Payload ()
346349 assert .Nil (t , err , "unexpected error" )
347350 assert .Equal (t , want , got , "wrong data" )
348351 })
349352 t .Run ("URL encoding" , func (t * testing.T ) {
350- got , err := b64Decode (b64Url )
353+ env := & Envelope {
354+ Payload : b64Url ,
355+ }
356+ got , err := env .DecodeB64Payload ()
351357 assert .Nil (t , err , "unexpected error" )
352358 assert .Equal (t , want , got , "wrong data" )
353359 })
354360
355361 t .Run ("Standard encoding - error" , func (t * testing.T ) {
356- got , err := b64Decode (b64StdErr )
362+ env := & Envelope {
363+ Payload : b64StdErr ,
364+ }
365+ got , err := env .DecodeB64Payload ()
357366 assert .NotNil (t , err , "expected error" )
358367 assert .Nil (t , got , "wrong data" )
359368 })
360369 t .Run ("URL encoding - error" , func (t * testing.T ) {
361- got , err := b64Decode (b64UrlErr )
370+ env := & Envelope {
371+ Payload : b64UrlErr ,
372+ }
373+ got , err := env .DecodeB64Payload ()
362374 assert .NotNil (t , err , "expected error" )
363375 assert .Nil (t , got , "wrong data" )
364376 })
0 commit comments