From 8a4db600c9e42f925281bb5cd4c6a4a987e1407f Mon Sep 17 00:00:00 2001 From: TwiN Date: Sun, 9 Oct 2022 21:34:36 -0400 Subject: [PATCH] test: Add tests for endpoint display name --- core/endpoint_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/endpoint_test.go b/core/endpoint_test.go index ee03449c..cac826f7 100644 --- a/core/endpoint_test.go +++ b/core/endpoint_test.go @@ -682,6 +682,15 @@ func TestIntegrationEvaluateHealthForICMP(t *testing.T) { } } +func TestEndpoint_DisplayName(t *testing.T) { + if endpoint := (Endpoint{Name: "n"}); endpoint.DisplayName() != "n" { + t.Error("endpoint.DisplayName() should've been 'n', but was", endpoint.DisplayName()) + } + if endpoint := (Endpoint{Group: "g", Name: "n"}); endpoint.DisplayName() != "g/n" { + t.Error("endpoint.DisplayName() should've been 'g/n', but was", endpoint.DisplayName()) + } +} + func TestEndpoint_getIP(t *testing.T) { endpoint := Endpoint{ Name: "invalid-url-test",