MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestBoolEqualBool

Function TestBoolEqualBool

types/opt/bool_test.go:101–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestBoolEqualBool(t *testing.T) {
102 tests := []struct {
103 b Bool
104 v bool
105 want bool
106 }{
107 {"", true, false},
108 {"", false, false},
109 {"unset", true, false},
110 {"unset", false, false},
111 {"sdflk;", true, false},
112 {"sldkf;", false, false},
113 {"true", true, true},
114 {"true", false, false},
115 {"false", true, false},
116 {"false", false, true},
117 {"1", true, false}, // "1" is not true; only "true" is
118 {"True", true, false}, // "True" is not true; only "true" is
119 }
120 for _, tt := range tests {
121 if got := tt.b.EqualBool(tt.v); got != tt.want {
122 t.Errorf("(%q).EqualBool(%v) = %v; want %v", string(tt.b), tt.v, got, tt.want)
123 }
124 }
125}
126
127func TestBoolNormalized(t *testing.T) {
128 tests := []struct {

Callers

nothing calls this directly

Calls 2

EqualBoolMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…