all: remove usage of constant errors

This commit is contained in:
Aleksandr Razumov
2017-02-11 06:54:37 +03:00
parent 03525bd44e
commit f1b2352162
8 changed files with 46 additions and 61 deletions

View File

@@ -1,25 +0,0 @@
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")
}
}