mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
22 lines
477 B
Go
22 lines
477 B
Go
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
|
||
|
package controlknobs
|
||
|
|
||
|
import (
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestAsDebugJSON(t *testing.T) {
|
||
|
var nilPtr *Knobs
|
||
|
if got := nilPtr.AsDebugJSON(); got != nil {
|
||
|
t.Errorf("AsDebugJSON(nil) = %v; want nil", got)
|
||
|
}
|
||
|
k := new(Knobs)
|
||
|
got := k.AsDebugJSON()
|
||
|
if want := reflect.TypeOf(Knobs{}).NumField(); len(got) != want {
|
||
|
t.Errorf("AsDebugJSON map has %d fields; want %v", len(got), want)
|
||
|
}
|
||
|
}
|