MCPcopy
hub / github.com/cloudflare/cloudflared / TestStaticFeatures

Function TestStaticFeatures

features/selector_test.go:213–224  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

211}
212
213func TestStaticFeatures(t *testing.T) {
214 percentages := []uint32{0}
215 // PostQuantum Enabled from user flag
216 selector := newTestSelector(t, percentages, true, time.Second)
217 snapshot := selector.Snapshot()
218 require.Equal(t, PostQuantumStrict, snapshot.PostQuantum)
219
220 // PostQuantum Disabled (or not set)
221 selector = newTestSelector(t, percentages, false, time.Second)
222 snapshot = selector.Snapshot()
223 require.Equal(t, PostQuantumPrefer, snapshot.PostQuantum)
224}
225
226func newTestSelector(t *testing.T, percentages []uint32, pq bool, refreshFreq time.Duration) *featureSelector {
227 logger := zerolog.Nop()

Callers

nothing calls this directly

Calls 3

newTestSelectorFunction · 0.85
SnapshotMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected