MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestFormatFromFlags

Function TestFormatFromFlags

internal/output/writer_test.go:145–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestFormatFromFlags(t *testing.T) {
146 if f := FormatFromFlags(true, false, false, false, false, false, false); f != FormatJSON {
147 t.Errorf("expected FormatJSON, got %d", f)
148 }
149 if f := FormatFromFlags(false, true, false, false, false, false, false); f != FormatQuiet {
150 t.Errorf("expected FormatQuiet, got %d", f)
151 }
152 if f := FormatFromFlags(false, false, true, false, false, false, false); f != FormatIDs {
153 t.Errorf("expected FormatIDs, got %d", f)
154 }
155 if f := FormatFromFlags(false, false, false, true, false, false, false); f != FormatCount {
156 t.Errorf("expected FormatCount, got %d", f)
157 }
158 if f := FormatFromFlags(false, false, false, false, false, false, true); f != FormatJSON {
159 t.Errorf("expected FormatJSON for --agent, got %d", f)
160 }
161 if f := FormatFromFlags(false, false, false, false, false, false, false); f != FormatAuto {
162 t.Errorf("expected FormatAuto, got %d", f)
163 }
164}
165
166func TestNormalizeJSONNumbers(t *testing.T) {
167 data := []byte(`{"id": 1234567890123456789}`)

Callers

nothing calls this directly

Calls 1

FormatFromFlagsFunction · 0.85

Tested by

no test coverage detected