Diameter event publishing, fixes #263

This commit is contained in:
DanB
2016-01-24 16:04:10 +01:00
parent cc5ec5177c
commit 5b828ec98f
9 changed files with 166 additions and 31 deletions

View File

@@ -579,3 +579,24 @@ func TestPaddingNotAllowed(t *testing.T) {
t.Error("Expected error")
}
}
func TestCastIfToString(t *testing.T) {
v := interface{}("somestr")
if sOut, casts := CastIfToString(v); !casts {
t.Error("Does not cast")
} else if sOut != "somestr" {
t.Errorf("Received: %+v", sOut)
}
v = interface{}(1)
if sOut, casts := CastIfToString(v); !casts {
t.Error("Does not cast")
} else if sOut != "1" {
t.Errorf("Received: %+v", sOut)
}
v = interface{}(1.2)
if sOut, casts := CastIfToString(v); !casts {
t.Error("Does not cast")
} else if sOut != "1.2" {
t.Errorf("Received: %+v", sOut)
}
}