MCPcopy Index your code
hub / github.com/chain/Core / TestInt

Function TestInt

env/env_test.go:11–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestInt(t *testing.T) {
12 result := Int("nonexistent", 15)
13 Parse()
14
15 if *result != 15 {
16 t.Fatalf("expected result=15, got result=%d", *result)
17 }
18
19 err := os.Setenv("int-key", "25")
20 if err != nil {
21 t.Fatal("unexpected error", err)
22 }
23
24 result = Int("int-key", 15)
25 Parse()
26
27 if *result != 25 {
28 t.Fatalf("expected result=25, got result=%d", *result)
29 }
30}
31
32func TestIntVar(t *testing.T) {
33 var result int

Callers

nothing calls this directly

Calls 2

IntFunction · 0.85
ParseFunction · 0.70

Tested by

no test coverage detected