MCPcopy Create free account
hub / github.com/anchordotdev/cli / TestScore_String

Function TestScore_String

detection/detection_test.go:11–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestScore_String(t *testing.T) {
12 testCases := []struct {
13 confidence Confidence
14 expectedString string
15 }{
16 {High, "High"},
17 {Medium, "Medium"},
18 {Low, "Low"},
19 {None, "None"},
20 {Confidence(42), "Unknown"}, // Unknown confidence scores
21 }
22
23 for _, testCase := range testCases {
24 t.Run(testCase.expectedString, func(t *testing.T) {
25 actualString := testCase.confidence.String()
26 if actualString != testCase.expectedString {
27 t.Errorf("Expected string representation %s, but got %s", testCase.expectedString, actualString)
28 }
29 })
30 }
31}
32
33func TestDefaultDetectors(t *testing.T) {
34 // Verify that the default detectors are present

Callers

nothing calls this directly

Calls 3

ConfidenceTypeAlias · 0.85
RunMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected