2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2014-08-27 02:20:02 +00:00
|
|
|
package consul
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestUserEventNames(t *testing.T) {
|
2017-05-22 22:14:27 +00:00
|
|
|
t.Parallel()
|
2014-08-27 02:20:02 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|