MCPcopy Create free account
hub / github.com/docker/docker-agent / TestPercentLabel

Function TestPercentLabel

cmd/root/agent_picker_test.go:238–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

236}
237
238func TestPercentLabel(t *testing.T) {
239 t.Parallel()
240
241 assert.Equal(t, "0%", percentLabel(0))
242 assert.Equal(t, "50%", percentLabel(0.5))
243 assert.Equal(t, "100%", percentLabel(1))
244 assert.Equal(t, "0%", percentLabel(-0.5))
245 assert.Equal(t, "100%", percentLabel(2))
246}
247
248func TestAgentPickerDetailsFixedSize(t *testing.T) {
249 t.Parallel()

Callers

nothing calls this directly

Calls 1

percentLabelFunction · 0.85

Tested by

no test coverage detected