From eb8de5f0b823a8450fcb7b9e3346705856dba748 Mon Sep 17 00:00:00 2001 From: Halo Arrow Date: Tue, 12 Sep 2023 10:55:46 -0400 Subject: [PATCH] Add test for computeAcceptKey --- util_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util_test.go b/util_test.go index f14d69a..032876c 100644 --- a/util_test.go +++ b/util_test.go @@ -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) + } +}