consul: Adding user event name tests
This commit is contained in:
parent
3a1d686444
commit
1227e77f6d
21
consul/serf_test.go
Normal file
21
consul/serf_test.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue