mirror of
https://github.com/status-im/consul.git
synced 2025-01-31 07:57:17 +00:00
consul: Adding user event name tests
This commit is contained in:
parent
be78e355de
commit
20d55e2ec4
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…
x
Reference in New Issue
Block a user