logs-analyzer/signoz/pkg/query-service/cache/status/status_test.go

44 lines
706 B
Go
Raw Permalink Normal View History

2024-09-02 22:47:30 +03:00
package status
import (
"testing"
)
func TestRetrieveStatusString(t *testing.T) {
tests := []struct {
status RetrieveStatus
want string
}{
{
status: RetrieveStatusHit,
want: "hit",
},
{
status: RetrieveStatusPartialHit,
want: "partial hit",
},
{
status: RetrieveStatusRangeMiss,
want: "range miss",
},
{
status: RetrieveStatusKeyMiss,
want: "key miss",
},
{
status: RetrieveStatusRevalidated,
want: "revalidated",
},
{
status: RetrieveStatusError,
want: "error",
},
}
for _, tt := range tests {
if got := tt.status.String(); got != tt.want {
t.Errorf("RetrieveStatus.String() = %v, want %v", got, tt.want)
}
}
}