MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestStatusSuffix

Function TestStatusSuffix

internal/cloud/cloud_test.go:102–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestStatusSuffix(t *testing.T) {
103 if got := (BudgetStatus{}).StatusSuffix(); got != "" {
104 t.Fatalf("zero value must render empty, got %q", got)
105 }
106 cases := []struct {
107 remaining float64
108 want string
109 }{
110 {1.0, " · 100% pass"},
111 {0.73, " · 73% pass"},
112 {0.005, " · 1% pass"},
113 {0.0, " · 0% pass"},
114 }
115 for _, tc := range cases {
116 got := BudgetStatus{Set: true, Remaining: tc.remaining}.StatusSuffix()
117 if got != tc.want {
118 t.Fatalf("Remaining=%v: got %q want %q", tc.remaining, got, tc.want)
119 }
120 }
121}
122
123func TestContextWindowFromHeaders(t *testing.T) {
124 cases := []struct {

Callers

nothing calls this directly

Calls 1

StatusSuffixMethod · 0.80

Tested by

no test coverage detected