MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestEmptyValue

Function TestEmptyValue

env/desc_test.go:32–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestEmptyValue(t *testing.T) {
33 t.Setenv("TEST_INT", "")
34
35 desc := env.Int("TEST_INT")
36 result := 123 // existing value
37 err := desc.Parse(&result)
38
39 require.NoError(t, err)
40 assert.Equal(t, 123, result) // value should not change
41}
42
43func TestParseFailure(t *testing.T) {
44 t.Setenv("TEST_INT", "not_a_number")

Callers

nothing calls this directly

Calls 2

IntFunction · 0.92
ParseMethod · 0.80

Tested by

no test coverage detected