Add test for computeAcceptKey

This commit is contained in:
Halo Arrow 2023-09-12 10:55:46 -04:00
parent 666c197fc9
commit eb8de5f0b8
1 changed files with 9 additions and 0 deletions

View File

@ -113,3 +113,12 @@ func TestParseExtensions(t *testing.T) {
} }
} }
} }
func TestComputeAcceptKey(t *testing.T) {
// Challenge and accept keys are from section 1.3 of the RFC.
got := computeAcceptKey("dGhlIHNhbXBsZSBub25jZQ==")
want := "s3pPLMBiTxaQ9kYGzzhZRbK+xOo="
if got != want {
t.Errorf("got %s, want %s", got, want)
}
}