Files
logwisp/cmd/lw/status_test.go
lixen 71d1b82f83
Test / test (push) Canceled after 0s
Test / e2e (push) Canceled after 0s
v0.22.0 several enhancements and fixes for security, network, doc, test, packaging
2026-10-03 14:52:16 -04:00

21 lines
604 B
Go

package main
import (
"slices"
"testing"
)
// A plugin's details map is spread into its status line: auth and TLS
// rejection counters live there and would otherwise never be reported.
func TestStatusLineCarriesPluginDetails(t *testing.T) {
fields := statsFields("Pipeline sources", "in", map[string]any{
"id": "in",
"details": map[string]any{"auth_rejected": uint64(3), "tls_handshake_errors": uint64(1)},
})
for _, key := range []string{"auth_rejected", "tls_handshake_errors"} {
if !slices.Contains(fields, any(key)) {
t.Errorf("status fields lack %s: %v", key, fields)
}
}
}