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

Function TestBool

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

Source from the content-addressed store, hash-verified

52}
53
54func TestBool(t *testing.T) {
55 result := Bool("nonexistent", true)
56 Parse()
57
58 if *result != true {
59 t.Fatalf("expected result=true, got result=%t", *result)
60 }
61
62 err := os.Setenv("bool-key", "true")
63 if err != nil {
64 t.Fatal("unexpected error", err)
65 }
66
67 result = Bool("bool-key", false)
68 Parse()
69
70 if *result != true {
71 t.Fatalf("expected result=true, got result=%t", *result)
72 }
73}
74
75func TestBoolVar(t *testing.T) {
76 var result bool

Callers

nothing calls this directly

Calls 2

BoolFunction · 0.70
ParseFunction · 0.70

Tested by

no test coverage detected