all: update client and server

This commit is contained in:
Aleksandr Razumov
2016-05-11 16:53:35 +03:00
parent 1f6a032d28
commit 7434b6616c
8 changed files with 329 additions and 7 deletions

25
errors_test.go Normal file
View File

@@ -0,0 +1,25 @@
package stun
import "testing"
func TestDecodeErr(t *testing.T) {
err := newDecodeErr("parent", "children", "message")
if !err.IsPlace(DecodeErrPlace{Parent: "parent", Children: "children"}) {
t.Error("isPlace test failed")
}
if !err.IsPlaceParent("parent") {
t.Error("parent test failed")
}
if !err.IsPlaceChildren("children") {
t.Error("children test failed")
}
if err.Error() != "BadFormat for parent/children: message" {
t.Error("bad Error string")
}
}
func TestError_Error(t *testing.T) {
if Error("error").Error() != "error" {
t.Error("bad Error string")
}
}