2018-12-26 17:50:01 +00:00
|
|
|
package xmpp // import "gosrc.io/xmpp"
|
2018-01-12 17:01:27 +00:00
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestHandshake(t *testing.T) {
|
|
|
|
c := Component{
|
|
|
|
Host: "test.localhost",
|
|
|
|
Secret: "mypass",
|
|
|
|
}
|
|
|
|
|
|
|
|
streamID := "1263952298440005243"
|
|
|
|
expected := "c77e2ef0109fbbc5161e83b51629cd1353495332"
|
|
|
|
|
2018-01-12 17:14:41 +00:00
|
|
|
result := c.handshake(streamID)
|
2018-01-12 17:01:27 +00:00
|
|
|
if result != expected {
|
|
|
|
t.Errorf("incorrect handshake calculation '%s' != '%s'", result, expected)
|
|
|
|
}
|
|
|
|
}
|
2018-01-25 22:16:55 +00:00
|
|
|
|
|
|
|
func TestGenerateHandshake(t *testing.T) {
|
|
|
|
// TODO
|
|
|
|
}
|