consul: Adding user event name tests

This commit is contained in:
Armon Dadgar 2014-08-26 19:20:02 -07:00
parent 3a1d686444
commit 1227e77f6d

21
consul/serf_test.go Normal file
View file

@ -0,0 +1,21 @@
package consul
import (
"testing"
)
func TestUserEventNames(t *testing.T) {
out := userEventName("foo")
if out != "consul:event:foo" {
t.Fatalf("bad: %v", out)
}
if !isUserEvent(out) {
t.Fatalf("bad")
}
if isUserEvent("foo") {
t.Fatalf("bad")
}
if raw := rawUserEventName(out); raw != "foo" {
t.Fatalf("bad: %v", raw)
}
}