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

Function TestVariableReadCorrectly

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

Source from the content-addressed store, hash-verified

10)
11
12func TestVariableReadCorrectly(t *testing.T) {
13 t.Setenv("TEST_INT", "42")
14
15 desc := env.Int("TEST_INT")
16 var result int
17 err := desc.Parse(&result)
18
19 require.NoError(t, err)
20 assert.Equal(t, 42, result)
21}
22
23func TestMissingVariable(t *testing.T) {
24 desc := env.Int("TEST_INT_MISSING")

Callers

nothing calls this directly

Calls 2

IntFunction · 0.92
ParseMethod · 0.80

Tested by

no test coverage detected