mirror of https://github.com/status-im/consul.git
consul: Adding user event name tests
This commit is contained in:
parent
be78e355de
commit
20d55e2ec4
|
@ -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 New Issue