mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-15 22:39:56 +00:00
28 lines
681 B
Go
28 lines
681 B
Go
// Copyright 2026 Beacon Contributors
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
package api
|
|
|
|
import "testing"
|
|
|
|
func TestRecordedChannelScopeStatus(t *testing.T) {
|
|
name := "#yow"
|
|
for _, tc := range []struct {
|
|
name *string
|
|
transport, valid bool
|
|
want string
|
|
}{
|
|
{&name, true, true, "matched"}, {nil, true, true, "unknown"},
|
|
{nil, false, true, "unscoped"}, {nil, false, false, "unavailable"},
|
|
{&name, false, false, "matched"},
|
|
} {
|
|
var transport *bool
|
|
if tc.valid {
|
|
transport = &tc.transport
|
|
}
|
|
if got := RecordedChannelScopeStatus(tc.name, transport); string(got) != tc.want {
|
|
t.Fatalf("got %s, want %s", got, tc.want)
|
|
}
|
|
}
|
|
}
|