Add a test for hash_key()

This commit is contained in:
Emmanuel Gil Peyrot 2020-01-10 16:13:28 +01:00
parent e66312b664
commit 44e65fcaf9
1 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,12 @@ mod test {
assert_eq!(format!("{}", OpCode::Bad), "BAD"); assert_eq!(format!("{}", OpCode::Bad), "BAD");
} }
#[test]
fn test_hash_key() {
let hash = hash_key(b"hello actix-web");
assert_eq!(&hash, "cR1dlyUUJKp0s/Bel25u5TgvC3E=");
}
#[test] #[test]
fn closecode_from_u16() { fn closecode_from_u16() {
assert_eq!(CloseCode::from(1000u16), CloseCode::Normal); assert_eq!(CloseCode::from(1000u16), CloseCode::Normal);