From 20d55e2ec4e0c421e192e4319e4c4fdb7041e31c Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Tue, 26 Aug 2014 19:20:02 -0700 Subject: [PATCH] consul: Adding user event name tests --- consul/serf_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 consul/serf_test.go diff --git a/consul/serf_test.go b/consul/serf_test.go new file mode 100644 index 0000000000..07225a7293 --- /dev/null +++ b/consul/serf_test.go @@ -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) + } +}