control/controlclient: unexport Status.state, add test-only accessor

Updates #cleanup
Updates #1909

Change-Id: I38dcde6fa0de0f58ede4529992cee2e36de33dd6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-08-30 10:21:56 -07:00
committed by Brad Fitzpatrick
parent 306b85b9a3
commit 9ce1f5c7d2
3 changed files with 17 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ func fieldsOf(t reflect.Type) (fields []string) {
func TestStatusEqual(t *testing.T) {
// Verify that the Equal method stays in sync with reality
equalHandles := []string{"LoginFinished", "LogoutFinished", "Err", "URL", "NetMap", "State", "Persist"}
equalHandles := []string{"LoginFinished", "LogoutFinished", "Err", "URL", "NetMap", "Persist", "state"}
if have := fieldsOf(reflect.TypeOf(Status{})); !reflect.DeepEqual(have, equalHandles) {
t.Errorf("Status.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
have, equalHandles)
@@ -52,13 +52,13 @@ func TestStatusEqual(t *testing.T) {
true,
},
{
&Status{State: StateNew},
&Status{State: StateNew},
&Status{state: StateNew},
&Status{state: StateNew},
true,
},
{
&Status{State: StateNew},
&Status{State: StateAuthenticated},
&Status{state: StateNew},
&Status{state: StateAuthenticated},
false,
},
{