consul: Adding user event name tests
This commit is contained in:
parent
3a1d686444
commit
1227e77f6d
|
@ -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