Skip to content

Commit

Permalink
Add test for computeAcceptKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Halo Arrow committed Sep 12, 2023
1 parent 666c197 commit eb8de5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit eb8de5f

Please sign in to comment.